[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Graphics' (#lcl)

TCanvas

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCanvas - where most of the drawing is performed

Declaration

Source position: graphics.pp line 950

type TCanvas = class(TFPCustomCanvas)

protected

  function DoCreateDefaultFont; override;

  

  function DoCreateDefaultPen; override;

  

  function DoCreateDefaultBrush; override;

  

  procedure SetColor(); override;

  

  function GetColor(); override;

  

  procedure SetHeight(); override;

  

  function GetHeight; override;

  

  procedure SetWidth(); override;

  

  function GetWidth; override;

  

  procedure SetPenPos(); override;

  

  procedure DoLockCanvas; override;

  

  procedure DoUnlockCanvas; override;

  

  procedure DoTextOut(); override;

  

  procedure DoGetTextSize(); override;

  

  function DoGetTextHeight(); override;

  

  function DoGetTextWidth(); override;

  

  procedure DoRectangle(); override;

  

  procedure DoRectangleFill(); override;

  

  procedure DoRectangleAndFill(); override;

  

  procedure DoEllipse(); override;

  

  procedure DoEllipseFill(); override;

  

  procedure DoEllipseAndFill(); override;

  

  procedure DoPolygon(); override;

  

  procedure DoPolygonFill(); override;

  

  procedure DoPolygonAndFill(); override;

  

  procedure DoPolyline(); override;

  

  procedure DoFloodFill(); override;

  

  procedure DoMoveTo(); override;

  

  procedure DoLineTo(); override;

  

  procedure DoLine(); override;

  

  procedure DoCopyRect(); override;

  

  procedure DoDraw(); override;

  

  procedure CheckHelper(); override;

  

  function GetClipRect; override;

  

  function GetPixel(); virtual;

  

GetPixel - retuns the colour of the pixel at the specified location

  procedure CreateBrush; virtual;

  

  procedure CreateFont; virtual;

  

  procedure CreateHandle; virtual;

  

CreateHandle - greates a new Handle for the Canvas

  procedure CreatePen; virtual;

  

  procedure CreateRegion; virtual;

  

CreateRegion - creates a rectangular region for the Canvas

  procedure DeselectHandles; virtual;

  

DeselectHandles - remove from group of selected handles

  procedure PenChanging(); virtual;

  

PenChanging - software emulation for call to OnChanging event for Pen

  procedure FontChanging(); virtual;

  

FontChanging - software emulation for call to OnChanging event for Font

  procedure BrushChanging(); virtual;

  

BrushChanging - software emulation for call to OnChanging event for Brush

  procedure RegionChanging(); virtual;

  

RegionChanging - software emulation for call to OnChanging event for Region

  procedure RealizeAutoRedraw; virtual;

  

RealizeAutoRedraw - implement th eAutoDraaw feature

  procedure RealizeAntialiasing; virtual;

  procedure RequiredState(); virtual;

  

RequiredState - the set of Canvas State required (csHandleValid, csFontValid, csPenvalid, csBrushValid, csRegionValid)

  procedure SetHandle(); virtual;

  

SetHandle - specify a Handle

  procedure SetInternalPenPos(); virtual;

  

SetInternalPenPos - specify position for the Pen

  procedure SetPixel(); virtual;

  

SetPixel - specify a colour for the stated pixel

  procedure FreeHandle; virtual;

  

FreeHandle - release a Handle

public

  constructor Create;

  destructor Destroy; override;

  procedure Lock; virtual;

  

Lock the canvas, making it unavailble for drawing

  procedure Unlock; virtual;

  

Unlock or release a previously locked Canvas

  procedure Refresh; virtual;

  

Refresh the drawing of the Canvas

  procedure Changing; virtual;

  

Changing - software emulation of a call to the OnChanging event

  procedure Changed; virtual;

  

Changed - software emulation of a call to the OnChange event

  procedure SaveHandleState; virtual;

  

SaveHandleState - stores the state of the Handle

  procedure RestoreHandleState; virtual;

  

RestoreHandleState - retrieves the saved state of the Handle

  procedure Arc();

  

Use Arc to draw an elliptically curved line with the current Pen

  procedure Chord();

  

Chord draws a filled Chord-shape on the canvas

  procedure CopyRect(); virtual;

  

Copies the rectangle found at Source in SrcCanvas to the destination position Dest

  procedure Draw(); virtual;

  procedure DrawFocusRect(); virtual;

  

DrawFocusRect - draws a focused rectangle at the specified position

  procedure StretchDraw(); virtual;

  procedure Ellipse();

  

Ellipse draws a filled circle or ellipse on the canvas

  procedure FillRect();

  

FillRect - draw a filled rectangle in the specified coordinate space

  procedure FloodFill(); virtual;

  procedure Frame3d(); virtual;

  

Frame3d - produce a frame with 3-D effect (with bevelled edges etc) in the specified rectangle

  procedure Frame();

  

Produce a Frame or border around the specified rectangle using a Pen

  procedure FrameRect();

  

FrameRect - produce a border around the specified rectangle using a Brush

  procedure GradientFill();

  

GradientFill - fill the specified rectangle with the specified colours in a gradient with the specified direction

  procedure Line();

  procedure LineTo(); virtual;

  procedure MoveTo(); virtual;

  procedure RadialPie(); virtual;

  

RadialPie uses Pie to draw a filled pie-shaped wedge on the canvas

  procedure Pie(); virtual;

  

Pie draws a filled Pie-shaped wedge on the canvas

  procedure PolyBezier();

  

Polybezier draws cubic Bezier curves

  procedure Polygon();

  

Polygon draws a closed, many-sided shape on the canvas, using the value of Pen

  procedure Polyline();

  

Polyline connects a set of points on the canvas

  procedure Rectangle();

  

Draws a Rectangle at the specified coordinates

  procedure RoundRect();

  

RoundRect - draws a rectangle at the specified position, with corners rounded by the factors RX, RY

  procedure TextOut(); virtual;

  procedure TextRect();

  

Writes Text string within a specified rectangle, according to predefined Style

  function TextExtent(); virtual;

  

TextExtent - returns the total size of the specified text

  function TextHeight(); virtual;

  

TextHeight - returns the height of the specified text

  function TextWidth(); virtual;

  

TextWidth - returns the width of the specified text

  function HandleAllocated; virtual;

  

HandleAllocated - returns True if a handle has been allocated

  function GetUpdatedHandle(); virtual;

  

GetUpdatedHandle - returns the value of the updated Handle

  property Pixels: TColor; [rw]

  

The colour of the Pixels located at the specified position

  property Handle: HDC; [rw]

  

The operating system Handle for this object

  property TextStyle: TTextStyle; [rw]

  

The TextStyle to be used in this Canvas

published

  property AntialiasingMode: TAntialiasingMode; [rw]

  property AutoRedraw: Boolean; [rw]

  

AutoRedraw - if True, the Canvas is to be redrawn automatically after each change or update

  property Brush: TBrush; [rw]

  

The Brush to be used for painting this Canvas

  property CopyMode: TCopymode; [rw]

  

The CopyMode to be used (arbitrary number)

  property Font: TFont; [rw]

  property Height: Integer; [r]

  property Pen: TPen; [rw]

  property Region: TRegion; [rw]

  

The Regionwhere the Canvas is located

  property Width: Integer; [r]

  property OnChange: TNotifyEvent; [rw]

  

Event handler for a change in the canvas

  property OnChanging: TNotifyEvent; [rw]

  

Event handler while canvas is changing

end;

Inheritance

TCanvas

  

TCanvas - where most of the drawing is performed

|

TFPCustomCanvas

|

TObject

Description

TCanvas is a class that defines a very large number of drawing methods including methods for pen and colour selection, producing shapes and filling them, setting or clearing individual pixels, and producing graphic text.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.