Click or drag to resize

Canvas Class

This class is used to draw primitives and text onto an AtalaImage, Bitmap, or Graphics object.
Inheritance Hierarchy
SystemObject
  Atalasoft.Imaging.DrawingCanvas

Namespace:  Atalasoft.Imaging.Drawing
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public class Canvas

The Canvas type exposes the following members.

Constructors
  NameDescription
Public methodCanvas(Graphics)
Initializes a new instance of a Canvas object specifying a Graphics to draw on.
Public methodCanvas(AtalaImage)
Initializes a new instance of a Canvas object specifying an AtalaImage to draw on.
Top
Properties
  NameDescription
Public propertyFontQuality
Gets or sets the quality for font rendering.
Public propertyInvertedOnGraphics
Gets or sets a value indicating if entities being drawn on a graphics object will be inverted.
Public propertySmoothingLevel
Gets or sets the amount of antialiasing applied to the entity being drawn onto this canvas.
Top
Methods
  NameDescription
Public methodStatic memberCalculateTextSize(String, Font)
Calculates the pixel size required to draw text using a specific font.
Public methodStatic memberCalculateTextSize(String, Font, TextFormat)
Calculates the pixel size required to draw text using a specific font and text format.
Public methodStatic memberCalculateTextSize(String, Size, Font, TextFormat)
Calculates the size of bound text without actually drawing it.
Public methodDrawEllipse(Rectangle, AtalaPen)
Draws an ellipse onto this canvas specifying the border pen.
Public methodDrawEllipse(Rectangle, Fill)
Draws an ellipse onto this canvas specifying the Fill.
Public methodDrawEllipse(Rectangle, AtalaPen, Fill)
Draws an ellipse onto this canvas specifying the border pen and Fill.
Public methodDrawLine
Draw a line onto this canvas.
Public methodDrawLines
Draws multiple connected lines onto this canvas.
Public methodDrawPolygon(Point, AtalaPen)
Draw a series of connected lines that form a closed polygon specifying the border pen.
Public methodDrawPolygon(Point, Fill)
Draw a series of connected lines that form a closed polygon specifying the inside fill.
Public methodDrawPolygon(Point, AtalaPen, Fill)
Draw a series of connected lines that form a closed polygon specifying the border pen and inside fill.
Public methodDrawRectangle(Rectangle, AtalaPen)
Draws a rectangle onto this canvas specifying the border pen.
Public methodDrawRectangle(Rectangle, Fill)
Draws a rectangle onto this canvas specifying the fill.
Public methodDrawRectangle(Rectangle, AtalaPen, Fill)
Draws a rectangle onto this canvas specifying the border pen and fill.
Public methodDrawRectangle(Rectangle, AtalaPen, Size)
Draws a rounded rectangle onto this canvas specifying the border pen.
Public methodDrawRectangle(Rectangle, Fill, Size)
Draws a rounded rectangle onto this canvas specifying the fill.
Public methodDrawRectangle(Rectangle, AtalaPen, Fill, Size)
Draws a rounded rectangle onto this canvas specifying the border pen and fill.
Public methodDrawRegion
Draws a filled region.
Public methodCode exampleDrawText(String, Point, Font, Fill)
Draw a single line text string onto this canvas specifying the upper left corner position.
Public methodDrawText(String, Rectangle, Font, Fill)
Draw multiline text onto this canvas specifying the rectangular bound area of the string.
Public methodDrawText(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.
Public methodDrawText(String, Point, Font, Fill, TextFormat)
Draw a single line text string onto this canvas specifying the upper left corner position and text formatting.
Public methodDrawText(String, Rectangle, Font, Fill, TextFormat)
Draw multiline text onto this canvas specifying the rectangular bound area of the string and text formatting.
Public methodDrawText(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.
Public methodDrawText(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.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

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

See Also