Encapsulates the GDI+ Graphics class as a Delphi TCustomCanvas descendant. The TRSGPCanvas class provides methods for drawing lines, curves, figures, images, and text. A TRSGPCanvas object stores attributes of the display device and attributes of the items to be drawn.
Like the VCL TCanvas class or the FMX TCanvas class, the TRSGPCanvas exposes Brush, Pen, and Font properties. The TRSGPCanvas class implements the TCustomCanvas class to provide easier sharing of code between the VCL TCanvas and the TRSGPCanvas. It also exposes methods that implement the GDI+ Graphics class like the FMX TCanvas class, providing easy sharing with the FMX library as well.
Namespace: RSGdiPlusGraphics
TCustomCanvas
RSGdiPlusGraphics.TRSGPCanvas
|
Delphi
|
type
TRSGPCanvas = class(TCustomCanvas)
end;
|
|
Name
|
Description
|
|
Brush
|
Determines the color and pattern for filling graphical shapes and backgrounds for the current canvas.
Set the Brush property to specify the color and pattern to use when drawing the background or filling in graphical shapes. The value of Brush is a RSGdiPlusGraphics.TRSGPBrush object.
Note
|
The Brush and Fill property refer to the same TRSGPBrush object. Use either one which is more compatible with your code from VCL or FMX
|
|
|
ClipRegion
|
Specifies the clipping region for the canvas.
The ClipRegion describes an area of the display surface. The area can be any shape. In other words, the boundary of the area can be a combination of curved and straight lines. Regions can also be created from the interiors of rectangles, paths, or a combination of these. Regions are used in clipping drawing operations and hit-testing operations.
|
|
CompositingMode
|
Specifies the compositing mode of the canvas
|
|
CompositingQuality
|
Specifies the compositing quality of the canvas. The compositing quality controls whether gamma correction is applied when colors are blended with background colors.
|
|
Fill
|
Determines the color and pattern for filling graphical shapes and backgrounds for the current canvas.
Set the Fill property to specify the color and pattern to use when drawing the background or filling in graphical shapes. The value of Fill is a RSGdiPlusGraphics.TRSGPBrush object.
Note
|
The Brush and Fill property refer to the same TRSGPBrush object. Use either one which is more compatible with your code from VCL or FMX
|
|
|
Font
|
Specifies the RSGdiPlusGraphics.TRSGPFont to use when writing text on the canvas.
Set the properties of TRSGPFont to specify the Family, Size, Style, and any other aspects of the font.
|
|
Handle
|
Returns the GDI+ handle of the Graphics object associated with the canvas
|
|
InterpolationMode
|
Specifies the interpolation mode currently set for this canvas. The interpolation mode determines the algorithm that is used when images are scaled or rotated.
|
|
Matrix
|
Specifies the world transformation of the canvas
|
|
PageScale
|
Specifies the scaling factor for the page transformation of this canvas object. The page transformation converts page coordinates to device coordinates.
|
|
PageUnit
|
Specifies the unit of measure for this canvas. The page unit belongs to the page transformation, which converts page coordinates to device coordinates.
|
|
Pen
|
Specifies the kind of pen (or stroke brush in FMX) the canvas uses for drawing lines and outlining shapes.
Set Pen to specify the pen to use for drawing lines and outlining shapes in the image. The value of Pen is a RSGdiPlusGraphics.TRSGPPen object. Set the properties of the TRSGPPen object to specify the color, fill, style, width, and mode of the pen.
Note
|
Setting the Pen property assigns the specified TRSGPPen object, rather than replacing the current TRSPPen object.
|
Note
|
The Stroke and Pen property refer to the same TRSGPPen object. Use either one which is more compatible with your code from VCL or FMX
|
|
|
PixelOffsetMode
|
Specifies the pixel offset mode of this canvas.
|
|
PixelsPerInchX
|
Returns the horizontal resolution, in dots per inch, of the display device associated with this canvas.
|
|
PixelsPerInchY
|
Returns the vertical resolution, in dots per inch, of the display device associated with this canvas.
|
|
SmoothingMode
|
Specifies the rendering quality of the canvas.
|
|
StringFormat
|
Specifies the text layout information (such as alignment, orientation, tab stops, and clipping) and display manipulations (such as trimming, font substitution for characters that are not supported by the requested font, and digit substitution for languages that do not use Western European digits). The string format is used in FillText calls.
|
|
Stroke
|
Specifies the kind of pen (or stroke brush in FMX) the canvas uses for drawing lines and outlining shapes.
Set Stroke to specify the pen to use for drawing lines and outlining shapes in the image. The value of Stroke is a RSGdiPlusGraphics.TRSGPPen object. Set the properties of the TRSGPPen object to specify the color, fill, style, width, and mode of the pen.
Note
|
Setting the Stroke property assigns the specified TRSGPPen object, rather than replacing the current TRSPPen object.
|
Note
|
The Stroke and Pen property refer to the same TRSGPPen object. Use either one which is more compatible with your code from VCL or FMX
|
|
|
TextContrast
|
Specifies the contrast value of this canvas. The contrast value is used for antialiasing text.
|
|
TextRenderingHint
|
Specifies the text rendering mode to use when drawing text. The process affects the quality of the text.
|
Top
|
|
Name
|
Description
|
|
AngleArc(Integer,Integer,Cardinal,Single,Single)
|
Draws an arc on the image along the perimeter of the circle defined by the parameters.
The AngleArc method draws a line from the current position to the starting point of the arc and then a counterclockwise circular arc to the arc endpoint. The arc traverses the perimeter of a circle whose center lies at (X,Y) and whose radius is Radius. The arc is drawn following the perimeter of the circle, counterclockwise, from the StartAngle with a sweep angle of SweepAngle.
If the sweep angle is greater than 360 degrees, the entire circle is drawn and part of the arc is drawn multiple times.
|
|
Arc(Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer)
|
Not implemented
|
|
ArcTo(Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer)
|
Not implemented
|
|
Assign(GpGraphics)
|
Overloaded. Copies a GDI+ Graphics object to the canvas
|
|
Assign(TPersistent)
|
Overloaded. Represents method Assign(TPersistent).
|
|
BrushCopy(TRect,TBitmap,TRect,TColor)
|
Not implemented
|
|
Chord(Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer)
|
Not implemented
|
|
Clear(TRSGPColor)
|
Clears the canvas to a specified color
|
|
CreateSaveState
|
Represents method CreateSaveState.
|
|
DoDrawEllipse(TRectF,Single,TRSGPPen)
|
Represents method DoDrawEllipse(TRectF,Single,TRSGPPen).
|
|
DoDrawImage(IRSGPImage,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Single,TRSGPUnit)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Single,TRSGPUnit).
|
|
DoDrawImage(IRSGPImage,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer).
|
|
DoDrawImage(IRSGPImage,Integer,Integer,Single)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,Integer,Integer,Single).
|
|
DoDrawImage(IRSGPImage,Single,Single,Single)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,Single,Single,Single).
|
|
DoDrawImage(IRSGPImage,Single,Single,Single,Single,Single,Single,Single,Single,Single,TRSGPUnit)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,Single,Single,Single,Single,Single,Single,Single,Single,Single,TRSGPUnit).
|
|
DoDrawImage(IRSGPImage,Single,Single,Single,Single,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,Single,Single,Single,Single,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer).
|
|
DoDrawImage(IRSGPImage,TPoints,Integer,Integer,Integer,Integer,Single,TRSGPUnit)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TPoints,Integer,Integer,Integer,Integer,Single,TRSGPUnit).
|
|
DoDrawImage(IRSGPImage,TPoints,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TPoints,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer).
|
|
DoDrawImage(IRSGPImage,TPoints,Single)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TPoints,Single).
|
|
DoDrawImage(IRSGPImage,TRect,Single)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TRect,Single).
|
|
DoDrawImage(IRSGPImage,TRectF,Single)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TRectF,Single).
|
|
DoDrawImage(IRSGPImage,TRSGPPoints,Single)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TRSGPPoints,Single).
|
|
DoDrawImage(IRSGPImage,TRSGPPoints,Single,Single,Single,Single,Single,TRSGPUnit)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TRSGPPoints,Single,Single,Single,Single,Single,TRSGPUnit).
|
|
DoDrawImage(IRSGPImage,TRSPoints,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Represents method DoDrawImage(IRSGPImage,TRSPoints,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer).
|
|
DoDrawLine(TPointF,TPointF,Single,TRSGPPen)
|
Represents method DoDrawLine(TPointF,TPointF,Single,TRSGPPen).
|
|
DoDrawPath(TRSGPPath,Single,TRSGPPen)
|
Represents method DoDrawPath(TRSGPPath,Single,TRSGPPen).
|
|
DoDrawRect(TRectF,Single,Single,TRSGPCorners,Single,TRSGPPen,TRSGPCornerType)
|
Overloaded. Represents method DoDrawRect(TRectF,Single,Single,TRSGPCorners,Single,TRSGPPen,TRSGPCornerType).
|
|
DoDrawRect(TRectF,Single,TRSGPPen)
|
Overloaded. Represents method DoDrawRect(TRectF,Single,TRSGPPen).
|
|
DoFillEllipse(TRectF,Single,TRSGPBrush)
|
Represents method DoFillEllipse(TRectF,Single,TRSGPBrush).
|
|
DoFillPath(TRSGPPath,Single,TRSGPBrush)
|
Represents method DoFillPath(TRSGPPath,Single,TRSGPBrush).
|
|
DoFillRect(TRectF,Single,TRSGPBrush)
|
Overloaded. Represents method DoFillRect(TRectF,Single,TRSGPBrush).
|
|
DoFillRoundRect(TRectF,Single,Single,TRSCorners,Single,TRSGPBrush,TRSCornerType)
|
Represents method DoFillRoundRect(TRectF,Single,Single,TRSCorners,Single,TRSGPBrush,TRSCornerType).
|
|
DoFillText(TRectF,string,TRSGPStringFormat,TRSGPFont,Single)
|
Represents method DoFillText(TRectF,string,TRSGPStringFormat,TRSGPFont,Single).
|
|
DoMeasureText(TRectF,string,TRSGPStringFormat,TRSGPFont)
|
Represents method DoMeasureText(TRectF,string,TRSGPStringFormat,TRSGPFont).
|
|
Draw(Integer,Integer,TGraphic)
|
Renders the graphic specified by the Graphic parameter on the canvas at the location given by the coordinates (X, Y). The image is rendered into a rectangle determined by the size of the graphic, with the upper-left corner at the point (X, Y).
|
|
Draw(Integer,Integer,TGraphic,Byte)
|
Renders the graphic specified by the Graphic parameter on the canvas at the location given by the coordinates (X, Y). The image is rendered into a rectangle determined by the size of the graphic, with the upper-left corner at the point (X, Y).
|
|
DrawArc(TPointF,TPointF,Single,Single,Single)
|
Overloaded. Draws an arc on the canvas.
The arc is created as a path containing the part of an ellipse contour. DrawArc draws this path on the current canvas with the current pen specified by the Stroke/ Pen property.
|
|
DrawArc(TPointF,TPointF,Single,Single,Single,TRSGPPen)
|
Overloaded. Draws an arc on the canvas.
The arc is created as a path containing the part of an ellipse contour. DrawArc draws this path on the current canvas with the specified pen.
|
|
DrawBitmap(TBitmap,TRectF,TRectF,Single,Boolean)
|
Draws a specified area from a TBitmap image after scaling it to a specified area of the canvas.
DrawBitmap is implemented by the TCanvas descendants to draw a specified rectangle area from a TBitmap image. The drawing is made to a specified rectangle area of the canvas. Before drawing, it scales the source image to the size of destination area.
DrawBitmap does nothing if ABitmap is empty. DrawBitmap does not raise any errors in this case.
|
|
DrawDashRect(TRectF,Single,Single,TRSCorners,Single,TAlphaColor)
|
Draws a rectangle with rounded corners, using the standard TRSGPPen, on the current canvas.
DrawDashRect draws the ARect rectangle with rounded corners, with the standard TRSGPPen, which has the following parameters: AColor color, Solid color pattern, Dash dashed line, and 1 pixel pen thickness.
|
|
DrawEllipse(TRectF,Single)
|
Overloaded. Draws an ellipse defined by a bounding rectangle structure and draws it on the current canvas.
Draw Ellipse is implemented by the TCanvas descendants to draw an ellipse defined by a bounding rectangle structure, with the current pen specified by the Stroke/ Pen property.
To customize the drawing pen, use the Stroke property.
|
|
DrawEllipse(TRectF,Single,TRSGPPen)
|
Overloaded. Draws an ellipse defined by a bounding rectangle structure and draws it on the current canvas.
Draw Ellipse is implemented by the TCanvas descendants to draw an ellipse defined by a bounding rectangle structure, with the specified stroke parameter.
|
|
DrawFocusRect(TRect)
|
Overloaded. Draws a rectangle in the style used to indicate that the object inside the rectangle has focus.
Implements the drawing of a focused rectangle. DrawFocusRect is called for the perimeter of the image of a control when the control gets or loses input focus.
|
|
DrawFocusRect(TRectF)
|
Overloaded. Draws a rectangle in the style used to indicate that the object inside the rectangle has focus.
Implements the drawing of a focused rectangle. DrawFocusRect is called for the perimeter of the image of a control when the control gets or loses input focus.
|
|
DrawImage(IRSGPImage,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image at the specified location and size
|
|
DrawImage(IRSGPImage,Integer,Integer,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(IRSGPImage,Integer,Integer,TRect,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(IRSGPImage,Single,Single,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(IRSGPImage,Single,Single,Single,Single,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image at the specified location and size
|
|
DrawImage(IRSGPImage,Single,Single,TRectF,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(IRSGPImage,TPoint,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(IRSGPImage,TPoint,TRect,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(IRSGPImage,TPointF,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(IRSGPImage,TPointF,TRectF,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(IRSGPImage,TPoints,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image transformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawImage(IRSGPImage,TPoints,Single)
|
Overloaded. Draws an image tranformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawImage(IRSGPImage,TPoints,TRect,Single,TRSGPUnit)
|
Overloaded. Represents method DrawImage(IRSGPImage,TPoints,TRect,Single,TRSGPUnit).
|
|
DrawImage(IRSGPImage,TRect,Single)
|
Overloaded. Draws an image at a specified location and size
|
|
DrawImage(IRSGPImage,TRect,TRect,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(IRSGPImage,TRectF,Single)
|
Overloaded. Draws an image at a specified location and size
|
|
DrawImage(IRSGPImage,TRectF,TRectF,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(IRSGPImage,TRSGPPoints,Single)
|
Overloaded. Draws an image transformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawImage(IRSGPImage,TRSGPPoints,TRectF,Single,TRSGPUnit)
|
Overloaded. Represents method DrawImage(IRSGPImage,TRSGPPoints,TRectF,Single,TRSGPUnit).
|
|
DrawImage(IRSGPImage,TRSPoints,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image transformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawImage(TRSGPImage,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image at the specified location and size
|
|
DrawImage(TRSGPImage,Integer,Integer,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(TRSGPImage,Integer,Integer,TRect,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(TRSGPImage,Single,Single,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(TRSGPImage,Single,Single,Single,Single,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image at the specified location and size
|
|
DrawImage(TRSGPImage,Single,Single,TRectF,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(TRSGPImage,TPoint,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(TRSGPImage,TPoint,TRect,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(TRSGPImage,TPointF,Single)
|
Overloaded. Draws an image at a specified location.
|
|
DrawImage(TRSGPImage,TPointF,TRectF,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(TRSGPImage,TPoints,Integer,Integer,Integer,Integer,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image transformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawImage(TRSGPImage,TPoints,Single)
|
Overloaded. Draws an image tranformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawImage(TRSGPImage,TPoints,TRect,Single,TRSGPUnit)
|
Overloaded. Represents method DrawImage(TRSGPImage,TPoints,TRect,Single,TRSGPUnit).
|
|
DrawImage(TRSGPImage,TRect,Single)
|
Overloaded. Draws an image at a specified location and size
|
|
DrawImage(TRSGPImage,TRect,TRect,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(TRSGPImage,TRectF,Single)
|
Overloaded. Draws an image at a specified location and size
|
|
DrawImage(TRSGPImage,TRectF,TRectF,Single,TRSGPUnit)
|
Overloaded. Draws a portion of an image at the specified location
|
|
DrawImage(TRSGPImage,TRSGPPoints,Single)
|
Overloaded. Draws an image transformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawImage(TRSGPImage,TRSGPPoints,TRectF,Single,TRSGPUnit)
|
Overloaded. Represents method DrawImage(TRSGPImage,TRSGPPoints,TRectF,Single,TRSGPUnit).
|
|
DrawImage(TRSGPImage,TRSPoints,Single,Single,Single,Single,TRSGPUnit,TRSGPImageAttributes,DrawImageAbort,Pointer)
|
Overloaded. Draws a portion of an image transformed to fit into a parallelogram specified by the Points parameter
The Points parameter must have a length of 3 to specify the coordinates of the upper-left corner, upper-right corner, and lower-left corner of the parallelogram. The coordinate of the lower-right corner is calculated using the three given coordinates, the width, and the height of the image. The portion of the source image to be drawn is scaled to fit the parallelogram.
|
|
DrawLine(TPoint,TPoint,Single)
|
Overloaded. Draws a line defined by two points on the current canvas.
DrawLine is implemented by the TCanvas descendants to draw a line defined by two points, with the current Stroke.
The APt1 and APt2 parameters are the two TPointF values. These parameters specify the end points of the line to draw.
To customize the drawing pen, use the Stroke or Pen properties.
|
|
DrawLine(TPoint,TPoint,Single,TRSGPPen)
|
Overloaded. Draws a line defined by two points on the current canvas.
DrawLine is implemented by the TCanvas descendants to draw a line defined by two points, with the current Stroke.
The APt1 and APt2 parameters are the two TPointF values. These parameters specify the end points of the line to draw.
To customize the drawing pen, use the Stroke or Pen properties.
|
|
DrawLine(TPointF,TPointF,Single)
|
Overloaded. Draws a line defined by two points on the current canvas.
DrawLine is implemented by the TCanvas descendants to draw a line defined by two points, with the current Stroke.
The APt1 and APt2 parameters are the two TPointF values. These parameters specify the end points of the line to draw.
To customize the drawing pen, use the Stroke or Pen properties.
|
|
DrawLine(TPointF,TPointF,Single,TRSGPPen)
|
Overloaded. Draws a line defined by two points on the current canvas.
DrawLine is implemented by the TCanvas descendants to draw a line defined by two points, with the current Stroke.
The APt1 and APt2 parameters are the two TPointF values. These parameters specify the end points of the line to draw.
To customize the drawing pen, use the Stroke or Pen properties.
|
|
DrawPath(TRSGPPath,Single)
|
Overloaded. Draws a path and displays it on the current canvas.
DrawPath draws a shape specified by a TRSGPPath, with the current pen specified by the Stroke or Pen properties.
If APath is empty, DrawPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling DrawPath, make sure that APath is created.
|
|
|
DrawPath(TRSGPPath,Single,TRSGPPen)
|
Overloaded. Draws a path and displays it on the current canvas.
DrawPath draws a shape specified by a TRSGPPath, with the specified pen.
If APath is empty, DrawPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling DrawPath, make sure that APath is created.
|
|
|
DrawPath(TRSPathData,Single)
|
Overloaded. Draws a path and displays it on the current canvas.
DrawPath draws a shape specified by a TRSPathData, with the current pen specified by the Stroke or Pen properties.
If APath is empty, DrawPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling DrawPath, make sure that APath is created.
|
|
|
DrawPath(TRSPathData,Single,TRSGPPen)
|
Overloaded. Draws a path and displays it on the current canvas.
DrawPath draws a shape specified by a TRSPathData, with the specified pen.
If APath is empty, DrawPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling DrawPath, make sure that APath is created.
|
|
|
DrawRect(TRectF,Single,Single,TRSGPCorners,Single,TRSGPCornerType)
|
Overloaded. Draws a rectangle with customized corners on the current canvas.
DrawRect is implemented by TCanvas descendants to draw--with the current stroke specified by the Stroke or Pen properties or with the brush specified by the ABrush parameter--the ARect rectangle with customized shapes of corners.
|
|
DrawRect(TRectF,Single,Single,TRSGPCorners,Single,TRSGPPen,TRSGPCornerType)
|
Overloaded. Draws a rectangle with customized corners on the current canvas.
DrawRect is implemented by TCanvas descendants to draw--with the current stroke specified by the Stroke or Pen properties or with the brush specified by the ABrush parameter--the ARect rectangle with customized shapes of corners.
|
|
DrawRectSides(TRectF,Single,Single,TRSCorners,Single,TRSSides,TRSCornerType)
|
Overloaded. Draws the specified sides of a rectangle with customized shapes of corners on the current canvas.
DrawRectSides draws the specified ASides sides of the ARect rectangle with customized shapes of corners, with the current Stroke or with the specified ABrush pen.
|
|
DrawRectSides(TRectF,Single,Single,TRSCorners,Single,TRSSides,TRSGPPen,TRSCornerType)
|
Overloaded. Draws the specified sides of a rectangle with customized shapes of corners on the current canvas.
DrawRectSides draws the specified ASides sides of the ARect rectangle with customized shapes of corners, with the current Stroke or with the specified ABrush pen.
|
|
Ellipse(Integer,Integer,Integer,Integer)
|
Overloaded. Draws the ellipse defined by a bounding rectangle on the canvas.
Implements the drawing a circle or ellipse on the canvas. Specify the bounding rectangle either by giving:
• The top left point at pixel coordinates (X1, Y1) and the bottom right point at (X2, Y2). • A TRect value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If the bounding rectangle is a square, a circle is drawn.
|
|
|
|
Ellipse(Integer,Integer,Integer,Integer,Single)
|
Overloaded. Draws the ellipse defined by a bounding rectangle on the canvas.
Implements the drawing a circle or ellipse on the canvas. Specify the bounding rectangle either by giving:
• The top left point at pixel coordinates (X1, Y1) and the bottom right point at (X2, Y2). • A TRect value.
|
If the bounding rectangle is a square, a circle is drawn.
FillArc(TPointF,TPointF,Single,Single,Single)
Overloaded. Fills an arc on the canvas.
The arc is created as a path containing the part of an ellipse contour. FillArc fills this path on the current canvas with the current brush specified by the Fill property.
FillArc(TPointF,TPointF,Single,Single,Single,TRSGPBrush)
Overloaded. Fills an arc on the canvas.
The arc is created as a path containing the part of an ellipse contour. FillArc fills this path on the current canvas with the specified brush.
FillEllipse(TRectF,Single)
Overloaded. Fills an ellipse defined by a bounding rectangle structure and draws it on the current canvas.
FillEllipse is implemented by the TCanvas descendants to fill an ellipse defined by a bounding rectangle structure, with the current brush specified by the Fill property.
FillEllipse(TRectF,Single,TRSGPBrush)
Overloaded. Fills an ellipse defined by a bounding rectangle structure and draws it on the current canvas.
FillEllipse is implemented by the TCanvas descendants to fill an ellipse defined by a bounding rectangle structure, with the current brush specified by the Fill property.
FillOutsideGradient(TRectF,Single,TRSGPBrush)
Overloaded. Represents method FillOutsideGradient(TRectF,Single,TRSGPBrush).
FillOutsideGradient(TRectF,TRSGPPath,Single,TRSGPBrush)
Overloaded. Represents method FillOutsideGradient(TRectF,TRSGPPath,Single,TRSGPBrush).
FillPath(TRSGPPath,Single)
Overloaded. Fills a path and displays it on the current canvas.
FillPath fills a shape specified by a TRSGPPath, with the current brush specified by the Fill property.
If APath is empty, FillPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling FillPath, make sure that APath is created.
|
FillPath(TRSGPPath,Single,TRSGPBrush)
Overloaded. Fills a path and displays it on the current canvas.
FillPath fills a shape specified by a TRSGPPath, with the current brush specified by the Fill property.
If APath is empty, FillPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling FillPath, make sure that APath is created.
|
FillPath(TRSPathData,Single)
Overloaded. Fills a path and displays it on the current canvas.
FillPath fills a shape specified by a TRSPathData, with the current brush specified by the Fill property.
If APath is empty, FillPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling FillPath, make sure that APath is created.
|
FillPath(TRSPathData,Single,TRSGPBrush)
Overloaded. Fills a path and displays it on the current canvas.
FillPath fills a shape specified by a TRSPathData, with the current brush specified by the Fill property.
If APath is empty, FillPath does nothing. In this case, it does not raise any errors.
Note
|
Before calling FillPath, make sure that APath is created.
|
FillRect(TRect)
Overloaded. Fills the specified rectangle on the canvas using the current brush.
Implements filling of a rectangular region using the current brush. The region is filled including the top and left edges of the rectangle, but excluding the bottom and right edges.
FillRect(TRectF,Single)
Overloaded. Fills the specified rectangle on the canvas using the current brush.
Implements filling of a rectangular region using the current brush. The region is filled including the top and left edges of the rectangle, but excluding the bottom and right edges.
FillRect(TRectF,Single,Single,TRSGPCorners,Single,TRSGPBrush,TRSGPCornerType)
Overloaded. Fills a rectangle with customized corners on the current canvas.
FillRect is implemented by TCanvas descendants to fill--with the current brush specified by the Fill property or with the brush specified by the ABrush parameter--the ARect rectangle with customized shapes of corners.
FillRect(TRectF,Single,Single,TRSGPCorners,Single,TRSGPCornerType)
Overloaded. Fills a rectangle with customized corners on the current canvas.
FillRect is implemented by TCanvas descendants to fill--with the current brush specified by the Fill property or with the brush specified by the ABrush parameter--the ARect rectangle with customized shapes of corners.
FillText(TRectF,string,Boolean,Single,TRSGPFillTextFlags,TRSGPFont,TRSGPStringAlignment,TRSGPStringAlignment)
Overloaded. Displays a text string on a specified rectangle area of the current canvas.
FillText is implemented by the TCanvas descendants to display a text string with the specified alignment and the specified font. The text is displayed in a specified rectangle area of the current canvas.
FillText(TRectF,string,Boolean,Single,TRSGPFillTextFlags,TRSGPStringAlignment,TRSGPStringAlignment)
Overloaded. Displays a text string on a specified rectangle area of the current canvas.
FillText is implemented by the TCanvas descendants to display a text string with the specified alignment and the current font specified by the Font property. The text is displayed in a specified rectangle area of the current canvas.
FillText(TRectF,string,Single)
Overloaded. Displays a text string on a specified rectangle area of the current canvas.
FillText draws a text string using the current string format and the specified font. The text is displayed in a specified rectangle area of the current canvas.
FillText(TRectF,string,TRSGPStringFormat,Single)
Overloaded. Displays a text string on a specified rectangle area of the current canvas.
FillText draws a text string using the specified String format and the current font specified by the Font property. The text is displayed in a specified rectangle area of the current canvas.
The StringFormat object specifies text layout information (such as alignment, orientation, tab stops, and clipping) and display manipulations (such as trimming, font substitution for characters that are not supported by the requested font, and digit substitution for languages that do not use Western European digits).
FillText(TRectF,string,TRSGPStringFormat,TRSGPFont,Single)
Overloaded. Displays a text string on a specified rectangle area of the current canvas.
FillText draws a text string using the specified String format and the specified font. The text is displayed in a specified rectangle area of the current canvas.
The StringFormat object specifies text layout information (such as alignment, orientation, tab stops, and clipping) and display manipulations (such as trimming, font substitution for characters that are not supported by the requested font, and digit substitution for languages that do not use Western European digits).
FloodFill(Integer,Integer,TColor,TFillStyle)
Not implemented
FrameRect(TRect)
Draws a rectangle using the current brush of the canvas to draw the border.
Implements the drawing a 1-pixel-wide border around a rectangular region. FrameRect does not fill the interior of the rectangle with the current brush pattern.
GetCanvasOrientation
Represents method GetCanvasOrientation.
GetClipRect
Represents method GetClipRect.
GetHandle
Represents method GetHandle.
GetPenPos
Represents method GetPenPos.
GetPixel(Integer,Integer)
Represents method GetPixel(Integer,Integer).
InitProperties
Initializes canvas properties based on the GDI+ values
InitResources
Creates and initializes the canvas resources
LineTo(Integer,Integer)
Draws a line on the canvas from PenPos to the point specified by X and Y, and sets the pen position to (X, Y).
Implements drawing a line from PenPos up to, but not including the point (X,Y). LineTo changes the value of PenPos to (X,Y).
MakeScreenshot(Integer,Integer)
Makes a screenshot of the contents of the canvas
MeasureText(TRectF,string,Boolean,TRSGPFillTextFlags,TRSGPFont,TRSGPStringAlignment,TRSGPStringAlignment)
Overloaded. Measures the area occupied by a text string with the specified alignments, flag, and the specified font, on the canvas.
MeasureText is implemented by the TCanvas descendants to determine the rectangle area occupied by a text string with the specified wrapping, alignments, flag, and specified font. The string text is framed in a rectangle.
The ARect parameter specifies the bounding rectangle of the text. ARect is the return variable. If ARect is not initialized, the returned rectangle is centered in (0,0).
MeasureText(TRectF,string,Boolean,TRSGPFillTextFlags,TRSGPStringAlignment,TRSGPStringAlignment)
Overloaded. Measures the area occupied by a text string with the specified alignments, flag, and current font, on the canvas.
MeasureText is implemented by the TCanvas descendants to determine the rectangle area occupied by a text string with the specified wrapping, alignments, flag, and current font. The string text is framed in a rectangle.
The ARect parameter specifies the bounding rectangle of the text. ARect is the return variable. If ARect is not initialized, the returned rectangle is centered in (0,0).
MeasureText(TRectF,string,TRSGPStringFormat)
Overloaded. Measures the area occupied by a text string with the specified alignments, flag, and current font, on the canvas.
MeasureText determines the rectangle area occupied by a text string with the specified text layout information and current font. The string text is framed in a rectangle.
The ARect parameter specifies the bounding rectangle of the text. ARect is the return variable. If ARect is not initialized, the returned rectangle is centered in (0,0).
The StringFormat object specifies text layout information (such as alignment, orientation, tab stops, and clipping) and display manipulations (such as trimming, font substitution for characters that are not supported by the requested font, and digit substitution for languages that do not use Western European digits).
MeasureText(TRectF,string,TRSGPStringFormat,TRSGPFont)
Overloaded. Measures the area occupied by a text string with the specified alignments, flag, and the specified font, on the canvas.
MeasureText determines the rectangle area occupied by a text string with the specified text layout information and specified font. The string text is framed in a rectangle.
The ARect parameter specifies the bounding rectangle of the text. ARect is the return variable. If ARect is not initialized, the returned rectangle is centered in (0,0).
The StringFormat object specifies text layout information (such as alignment, orientation, tab stops, and clipping) and display manipulations (such as trimming, font substitution for characters that are not supported by the requested font, and digit substitution for languages that do not use Western European digits).
MoveTo(Integer,Integer)
Changes the current drawing position to the point (X,Y).
Implements the setting the value of PenPos before calling LineTo. Calling MoveTo is equivalent to setting the PenPos property.
Notification(TRSGPGraphicsObject,TOperation)
Represents method Notification(TRSGPGraphicsObject,TOperation).
Pie(Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer)
Not implemented
PolyBezier(TPoint[])
Draws a set of Bezier curves.
Implements drawing cubic Bezier curves using the endpoints and control points specified by the Points parameter. The first curve is drawn from the first point to the fourth point, using the second and third points as control points. Each subsequent curve in the sequence needs exactly three more points: the ending point of the previous curve is used as the starting point, the next two points in the sequence are control points, and the third is the ending point. PolyBezier draws lines by using the current pen.
The Points parameter gives the endpoints to use when generating the Bezier curves. Control points after a[Index+3] are ignored. Nothing happens if there are not enough control points.
Note
|
In Delphi, you can use the Slice function to pass a portion of an array of points to the PolyBezier method. For example, to form a Bezier curve using the first ten points from an array of 100 points, use the Slice function as follows: Canvas.PolyBezier(Slice(PointArray, 10));
|
PolyBezierTo(TPoint[])
Draws a set of Bezier curves and updates the value of PenPos.
Implements drawing cubic Bezier curves using the endpoints and control points specified by the Points parameter. The first curve is drawn from the first point to the fourth point, using the second and third points as control points. Each subsequent curve in the sequence needs exactly three more points: the ending point of the previous curve is used as the starting point, the next two points in the sequence are control points, and the third is the ending point. PolyBezierTo draws lines by using the current pen and updates the value of PenPos to the value of the last endpoint.
The Points parameter gives the endpoints to use when generating the Bezier curves. Control points after a[Index+3] are ignored. Nothing happens if there are not enough control points.
Note
|
In Delphi, you can use the Slice function to pass a portion of an array of points to the PolyBezierTo method. For example, to form a Bezier curve using the first ten points from an array of 100 points, use the Slice function as follows: Canvas.PolyBezierTo(Slice(PointArray, 10));
|
Polygon(TPoint[])
Draws a series of lines on the canvas connecting the points passed in and closing the shape by drawing a line from the last point to the first point.
Implements drawing a closed, many-sided shape on the canvas, using the value of Pen. After drawing the complete shape, Polygon fills the shape using the current brush.
The Points parameter is an array of points that give the vertices of the polygon. The first point is always connected to the last point.
To draw a polygon on the canvas, without filling it, use the Polyline method, specifying the first point a second time, at the end.
Note
|
In Delphi, you can use the Slice function to pass a portion of an array of points to the Polygon method. For example, to form a polygon using the first ten points from an array of 100 points, use the Slice function as follows: Canvas.Polygon(Slice(PointArray, 10));
|
Polyline(TPoint[])
Draws a series of lines on the canvas with the current pen, connecting each of the points passed to it in Points.
Implements connecting a set of points on the canvas. If you specify only two points, Polyline draws a single line.
The Points parameter is an array of points to be connected.
Calling the MoveTo function with the value of the first point, and then repeatedly calling LineTo with all subsequent points will draw the same image on the canvas. However, unlike LineTo, Polyline does not change the value of PenPos.
Note
|
In Delphi, you can use the Slice function to pass a portion of an array of points to the Polyline method. For example, to form a polygon using the first ten points from an array of 100 points, use the Slice function as follows: Canvas.Polyline(Slice(PointArray, 10));
|
Rectangle(Integer,Integer,Integer,Integer)
Draws a rectangle on the canvas.
Implements drawing a rectangle using the pen and filling it with the current brush.
To fill a rectangular region without drawing the boundary in the current pen, use FillRect. To outline a rectangular region without filling it, use FrameRect or Polygon. To draw a rectangle with rounded corners, use RoundRect.
Refresh
Not implemented
RequiredState(TCanvasState)
Represents method RequiredState(TCanvasState).
RestoreCurrentState(TRSGPSaveState)
Restores the current transformations, clipping region, and quality settings of the canvas to a saved state.
RestoreCurrentState restores a previous saved state of the canvas.
Call RestoreCurrentState to restore the drawing and filling properties (excluding the Stroke, Fill, and Font properties) to values saved in previous moments of the drawing process.
The State parameter specifies the pointer to the saved data. After the state is restored, the saved data are freed. If State is empty, RestoreCurrentState raises an exception.
To save the canvas state, call SaveCurrentState.
RestoreState(TRSGPCanvasSaveState)
Restores the current transformations, clipping region, and quality settings, as well as drawing and filling properties of the canvas to a saved state.
RestoreState restores a previous saved state of the canvas.
Call RestoreState to restore the drawing and filling properties to values saved in previous moments of the drawing process.
The State parameter specifies the pointer to the saved data. After the state is restored, the saved data are freed. If State is empty, RestoreState raises an exception.
To save the canvas state, call SaveState.
RoundRect(Integer,Integer,Integer,Integer,Integer,Integer)
Draws a rectangle with rounded corners on the canvas.
Implements drawing a rounded rectangle using the current pen and fill it with the current brush. The rectangle will have edges defined by the points (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2), but the corners will be shaved to create a rounded appearance. The curve of the rounded corners matches the curvature of an ellipse with width X3 and height Y3.
To draw an ellipse instead, use Ellipse. To draw a true rectangle, use Rectangle.
RSGPPath(TRSPathData)
Creates a GDI+ path that is a copy of the TRSPathData path.
Note
|
The calling method should free the created path
|
SaveCurrentState
Saves the current GDI+ state (transformations, clipping region, and quality settings) of the canvas. Note that this does not include Fill, Stroke, or Font properties. To also save these properties, call SaveState instead.
Call SaveCurrentState to save the drawing and filling properties in different moments of the drawing process.
SaveCurrentState returns a TRSGPSaveState object.
To restore the saved states, call RestoreCurrentState.
SaveState
Saves the current transformations, clipping region, and quality settings, as well as drawing and filling properties of the canvas.
SaveState saves the current state of the canvas. The properties are saved to be restored later.
Call SaveState to save the drawing and filling properties in different moments of the drawing process.
SaveState returns a TRSGPCanvasSaveState object.
To restore the saved states, call RestoreState.
SetMatrix(TRSGPMatrix)
Sets the world transformation of the canvas
SetPenPos(TPoint)
Represents method SetPenPos(TPoint).
SetPixel(Integer,Integer,TColor)
Represents method SetPixel(Integer,Integer,TColor).
StretchDraw(TRect,TGraphic)
Draws the graphic specified by the Graphic parameter in the rectangle specified by the Rect parameter.
Implements drawing a graphic on the canvas so that the image fits in the specified rectangle.
To render the graphic in its natural size, use the Draw method instead.
TextExtent(string)
Returns the width and height, in pixels, of a string rendered in the current font.
Provides information about the space a string will occupy in the image. Other elements in the image such as lines, boxes, or additional lines of text can be positioned to accommodate the size of the text. TextExtent returns the width and height of the rectangle that bounds the text on the canvas.
Both the TextHeight and TextWidth methods call TextExtent to obtain the height and width information.
TextExtentF(string)
Returns the width and height, in pixels, of a string rendered in the current font.
Provides information about the space a string will occupy in the image. Other elements in the image such as lines, boxes, or additional lines of text can be positioned to accommodate the size of the text. TextExtent returns the width and height of the rectangle that bounds the text on the canvas.
Both the TextHeight and TextWidth methods call TextExtent to obtain the height and width information.
TextHeight(string)
Represents method TextHeight(string).
TextOut(Integer,Integer,string)
Overloaded. Writes a string on the canvas, starting at the point (X,Y), and then updates the PenPos to the end of the string.
Implements writing a string onto the canvas. The string will be written using the current font. Use the TextExtent method to determine the space occupied by text in the image. To write only the text that fits within a clipping rectangle, use TextRect instead.
After a call to TextOut, the PenPos property indicates the point at the top right of the text on the canvas.
TextOut(Single,Single,string)
Overloaded. Writes a string on the canvas, starting at the point (X,Y), and then updates the PenPos to the end of the string.
Implements writing a string onto the canvas. The string will be written using the current font. Use the TextExtent method to determine the space occupied by text in the image. To write only the text that fits within a clipping rectangle, use TextRect instead.
After a call to TextOut, the PenPos property indicates the point at the top right of the text on the canvas.
TextRect(TRect,Integer,Integer,string)
Overloaded. Writes a string inside a clipping rectangle.
Implements writing a string within a limited rectangular region. Any portions of the string that fall outside the rectangle passed in the Rect parameter are clipped and do not appear. The upper-left corner of the text is placed at the point (X, Y).
TextRect(TRect,string,TTextFormat)
Overloaded. Not implemented
TextWidth(string)
TextWidthTight(string)
Represents method TextWidthTight(string).
TrySmoothingMode(TRSGPSmoothingMode)
Attempts to set the SmoothingMode of the canvas to the mode and returns true if it can be done. If the attempt fails, the smoothing mode will be reset to the current mode.
Top
To create the GDI+ canvas, provide a VCL TCanvas to its constructor:
Delphi
|
var
GPCanvas: TRSGPCanvas;
begin
GPCanvas := TRSGPCanvas.Create(aCanvas);
try
GPCanvas.Brush.Kind := bkSolid;
GPCanvas.Brush.Color := TRSGPColorRec.Red;
GPCanvas.FillEllipse(RectF(0, 0, 100, 100), 0.5);
finally
GPCanvas.Free;
end;
end;
|
|