TLazCanvas class
Implements a canvas which masks differences between FCL and LCL canvas classes.
Declaration
TLazCanvas = class(TFPImageCanvas)Inheritance
- TLazCanvas
TFPImageCanvas
Description
TLazCanvas is an FCL
TFPImageCanvas descendant.
TLazCanvas extends the ancestor class to support stretching filters and
features found in the
TCanvas class from the LCL. TLazCanvas also
fixes various small problems and incompatibilities between
TFPImageCanvas versions, making the interface smoother and more
consistent.
TLazCanvas is used in the implementation of custom-drawn widgetset classes, and provides a device context used to perform drawing operations for a control.
There are several useful examples using TLazCanvas on the Lazarus Wiki at:
See also
Properties
AssignedPen | public | Pen assigned to the canvas. |
AssignedBrush | public | Brush assigned to the canvas. |
AssignedFont | public | Font assigned to the canvas. |
BaseWindowOrg | public | Base window origin for the canvas. |
WindowOrg | public | Window origin for the canvas. |
Methods
SetColor | protected | Sets the color for the pixel at the specified coordinates. |
DoCreateDefaultFont | protected | Creates the custom font used as the default for the canvas. |
DoRectangle | protected | Adjusts the fcl-image coordinate system to be compatible with coordinates used in TCanvas. |
DoRectangleFill | protected | Adjusts the FCL image rectangle to be LCL compatible and draws a filled rectangle on the canvas. |
DoPolygonFill | protected | Implements a polygon fill algorithm not present in fcl-image prior to FPC version 3.2.3. |
DoLine | protected | Draws a line using the specified coordinates and Pen for the canvas. |
DoCopyRect | protected | Performs actions needed to copy a source rectangle from the specified canvas. |
DoDraw | protected | Performs actions needed to draws the specified image at the given coordinates using AlphaBlending. |
create | public | Constructor for the class instance. |
destroy | public | Destructor for the class instance. |
SetLazClipRegion | public | Sets the value in the ClipRegion property. |
SaveState | public | Saves the current canvas state in the GraphicStateList member. |
RestoreState | public | Restores the canvas to the state stored at the specified position. |
ResetCanvasState | public | Sets the canvas to the default values/state used in the LCL TCanvas class. |
AlphaBlend | public | Alpha blends the specified content from the source canvas onto the canvas instance. |
AlphaBlendIgnoringDestPixels | public | Performs an AlphaBlend operation assuming a white background. |
AlphaBlend_Image | public | AlphaBlends the specified image onto the canvas. |
DoDrawImage | public | Calls DoDraw for the specified image and coordinates. |
CanvasCopyRect | public | Copies the contents of a supported image format in ASource to the canvas. |
FillColor | public | Fills the entire drawing area with the specified color. |
Polygon | public | Overloaded method which adds support for the non-zero winding rule. |
AssignPenData | public | Sets the Pen data for the canvas. |
AssignBrushData | public | Sets the Brush data for the canvas. |
AssignFontData | public | Sets the Font data for the canvas. |
Fields
HasNoImage | public | Indicates if a valid image was provided in the constructor. |
NativeDC | public | Native device context for the canvas. |
ExtraFontData | public | Member with extra FreeType font data from the canvas or device context. |
ImageFormat | public | Member with the TLazCanvasImageFormat instance used to speed up drawing. |
SelectedBitmap | public | Member with the GDI Handle for an image. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
