Sign in Join
FPDoc Onlineexperiment

TLazCanvas class

In unit LazCanvas

Implements a canvas which masks differences between FCL and LCL canvas classes.

Declaration

pascal
TLazCanvas = class(TFPImageCanvas)

Inheritance

  1. TLazCanvas
  2. 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:

Developing with Graphics

See also

Properties

AssignedPenpublicPen assigned to the canvas.
AssignedBrushpublicBrush assigned to the canvas.
AssignedFontpublicFont assigned to the canvas.
BaseWindowOrgpublicBase window origin for the canvas.
WindowOrgpublicWindow origin for the canvas.

Methods

SetColorprotectedSets the color for the pixel at the specified coordinates.
DoCreateDefaultFontprotectedCreates the custom font used as the default for the canvas.
DoRectangleprotectedAdjusts the fcl-image coordinate system to be compatible with coordinates used in TCanvas.
DoRectangleFillprotectedAdjusts the FCL image rectangle to be LCL compatible and draws a filled rectangle on the canvas.
DoPolygonFillprotectedImplements a polygon fill algorithm not present in fcl-image prior to FPC version 3.2.3.
DoLineprotectedDraws a line using the specified coordinates and Pen for the canvas.
DoCopyRectprotectedPerforms actions needed to copy a source rectangle from the specified canvas.
DoDrawprotectedPerforms actions needed to draws the specified image at the given coordinates using AlphaBlending.
createpublicConstructor for the class instance.
destroypublicDestructor for the class instance.
SetLazClipRegionpublicSets the value in the ClipRegion property.
SaveStatepublicSaves the current canvas state in the GraphicStateList member.
RestoreStatepublicRestores the canvas to the state stored at the specified position.
ResetCanvasStatepublicSets the canvas to the default values/state used in the LCL TCanvas class.
AlphaBlendpublicAlpha blends the specified content from the source canvas onto the canvas instance.
AlphaBlendIgnoringDestPixelspublicPerforms an AlphaBlend operation assuming a white background.
AlphaBlend_ImagepublicAlphaBlends the specified image onto the canvas.
DoDrawImagepublicCalls DoDraw for the specified image and coordinates.
CanvasCopyRectpublicCopies the contents of a supported image format in ASource to the canvas.
FillColorpublicFills the entire drawing area with the specified color.
PolygonpublicOverloaded method which adds support for the non-zero winding rule.
AssignPenDatapublicSets the Pen data for the canvas.
AssignBrushDatapublicSets the Brush data for the canvas.
AssignFontDatapublicSets the Font data for the canvas.

Fields

HasNoImagepublicIndicates if a valid image was provided in the constructor.
NativeDCpublicNative device context for the canvas.
ExtraFontDatapublicMember with extra FreeType font data from the canvas or device context.
ImageFormatpublicMember with the TLazCanvasImageFormat instance used to speed up drawing.
SelectedBitmappublicMember with the GDI Handle for an image.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.