GraphImage

public sealed class GraphImage : IDisposable
Represents a single image with a grid useful for creating function graphics.

Constructors

GraphImage

#
public GraphImage(FrameF frame, OrthoGrid grid)
Create a new Graph image.
frame (FrameF)Frame of image.
grid (OrthoGrid)Grid properties.

GraphImage

#
public GraphImage(int width, int height, int unitSize, Point origin, OrthoGrid grid)
Create a new Graph image.
width (int)Width of image.
height (int)Height of image.
unitSize (int)Number of pixels per graph space unit.
origin (Point)Origin of grid in pixel coordinates.
grid (OrthoGrid)Grid properties.

GraphImage

#
public GraphImage(int width, int height, int unitSize, Point origin)
Create a new Graph image with a default grid.
width (int)Width of image.
height (int)Height of image.
unitSize (int)Number of pixels per graph space unit.
origin (Point)Origin of grid in pixel coordinates.

GraphImage

#
public GraphImage(int width, int height, int unitSize)
Create a new Graph image with a default grid.
width (int)Width of image.
height (int)Height of image.
unitSize (int)Number of pixels per graph space unit.

Properties

Frame

#
public FrameF Frame { get; }
Gets the frame projection for this image.

Graphics

#
public Graphics Graphics { get; }
Gets the graphics object underlying this instance. This will be null once this instance has been disposed.

Grid

#
public OrthoGrid Grid { get; }
Gets the ortho grid hosted inside this image.

Image

#
public Bitmap Image { get; }
Gets the bitmap underlying this instance. This will be null once this instance has been disposed.

Methods

Dispose

#
public void Dispose()

DrawGraph

#
public void DrawGraph(Function function, Pen edge)
Draw a function into the image.
function (Function)Function to draw.
edge (Pen)Pen properties.

DrawGrid

#
public void DrawGrid(GridElements elements = GridElements.All)
Draw the grid into the image.
elements (GridElements = GridElements.All)

Project

#
public PointF Project(double x, double y)
Project a point from graph space into pixel space.
x (double)
y (double)

Project

#
public PointF Project(Point2d point)
Project a point from graph space into pixel space.
point (Point2d)

Save

#
public void Save(string file)
Try and save the image to a file.
file (string)