Canvas Class |
Namespace: Atalasoft.Imaging.Drawing
The Canvas type exposes the following members.
Name | Description | |
---|---|---|
Canvas(Graphics) | Initializes a new instance of a Canvas object specifying a Graphics to draw on.
| |
Canvas(AtalaImage) | Initializes a new instance of a Canvas object specifying an AtalaImage to draw on.
|
Name | Description | |
---|---|---|
FontQuality | Gets or sets the quality for font rendering. | |
InvertedOnGraphics | Gets or sets a value indicating if entities being drawn on a graphics object will be inverted. | |
SmoothingLevel | Gets or sets the amount of antialiasing applied to the entity being drawn onto this canvas. |
Name | Description | |
---|---|---|
CalculateTextSize(String, Font) | Calculates the pixel size required to draw text using a specific font. | |
CalculateTextSize(String, Font, TextFormat) | Calculates the pixel size required to draw text using a specific font and text format. | |
CalculateTextSize(String, Size, Font, TextFormat) | Calculates the size of bound text without actually drawing it. | |
DrawEllipse(Rectangle, AtalaPen) | Draws an ellipse onto this canvas specifying the border pen. | |
DrawEllipse(Rectangle, Fill) | Draws an ellipse onto this canvas specifying the Fill. | |
DrawEllipse(Rectangle, AtalaPen, Fill) | Draws an ellipse onto this canvas specifying the border pen and Fill. | |
DrawLine | Draw a line onto this canvas. | |
DrawLines | Draws multiple connected lines onto this canvas. | |
DrawPolygon(Point, AtalaPen) | Draw a series of connected lines that form a closed polygon specifying the border pen. | |
DrawPolygon(Point, Fill) | Draw a series of connected lines that form a closed polygon specifying the inside fill. | |
DrawPolygon(Point, AtalaPen, Fill) | Draw a series of connected lines that form a closed polygon specifying the border pen and inside fill.
| |
DrawRectangle(Rectangle, AtalaPen) | Draws a rectangle onto this canvas specifying the border pen. | |
DrawRectangle(Rectangle, Fill) | Draws a rectangle onto this canvas specifying the fill. | |
DrawRectangle(Rectangle, AtalaPen, Fill) | Draws a rectangle onto this canvas specifying the border pen and fill. | |
DrawRectangle(Rectangle, AtalaPen, Size) | Draws a rounded rectangle onto this canvas specifying the border pen. | |
DrawRectangle(Rectangle, Fill, Size) | Draws a rounded rectangle onto this canvas specifying the fill. | |
DrawRectangle(Rectangle, AtalaPen, Fill, Size) | Draws a rounded rectangle onto this canvas specifying the border pen and fill. | |
DrawRegion | Draws a filled region. | |
DrawText(String, Point, Font, Fill) | Draw a single line text string onto this canvas specifying the upper left corner position. | |
DrawText(String, Rectangle, Font, Fill) | Draw multiline text onto this canvas specifying the rectangular bound area of the string. | |
DrawText(String, Point, Font, Fill, SolidFill) | Draw a single line text string onto this canvas specifying the upper left corner position and a solid
background color. | |
DrawText(String, Point, Font, Fill, TextFormat) | Draw a single line text string onto this canvas specifying the upper left corner position and text
formatting. | |
DrawText(String, Rectangle, Font, Fill, TextFormat) | Draw multiline text onto this canvas specifying the rectangular bound area of the string and text
formatting. | |
DrawText(String, Point, Font, Fill, SolidFill, TextFormat) | Draw a single line text string onto this canvas specifying the upper left corner position and a solid
background color. | |
DrawText(String, Rectangle, Font, Fill, SolidFill, TextFormat) | Draw a single line text string onto this canvas specifying the upper left corner position and a solid
background color. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
To use the canvas class, create an instance specifying the object that will be drawn on in the constructor. If you're using the WorkspaceViewer WinControl, you will have to invoke ClearCache to show the changes to the image.
The drawing class has some advantages over using the Graphics object in GDI+. You may draw directly onto grayscale, colormapped, and 1-bit document images. In addition, you can choose the border color and line type with an AtalaPen, and if the drawing entity supports it, a Fill to use to fill the inside of the entity. The various Fill objects can be used for solid, hatched, gradient, or textured filled areas for both the border and inside of the entity.
A smoothingLevel can be specified in the canvas object which can be configured to enable antialising of the drawn objects.
In addition, when drawing onto a graphics object, you may specify an inverted pen, using the XOR algorithm when drawing any entity onto the device. This property is ignored