[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'FPCanvas' (#fcl)

TFPCustomCanvas

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

TFPCustomCanvas - FreePascal base class for Canvas

Declaration

Source position: fpcanvas.pp line 192

type TFPCustomCanvas = class(TPersistent)

protected

  function DoCreateDefaultFont; virtual; abstract;

  

DoCreateDefaultFont - returns a newly created default Font

  function DoCreateDefaultPen; virtual; abstract;

  

DoCreateDefaultPen - returns a newly created default Pen

  function DoCreateDefaultBrush; virtual; abstract;

  

DoCreateDefaultBrush - returns a newly created default Brush

  procedure SetFont(); virtual;

  

SetFont - specifies the Font to use

  procedure SetBrush(); virtual;

  

SetBrush - specifies the Brush to use

  procedure SetPen(); virtual;

  

SetPen - specifies the Pen to use

  function DoAllowFont(); virtual;

  

DoAllowFont - returns True if specified Font is valid

  function DoAllowPen(); virtual;

  

DoAllowPen - returns True if specified Pen is valid

  function DoAllowBrush(); virtual;

  

DoAllowBrush - returns True if specified Brush is valid

  procedure SetColor(); virtual; abstract;

  

SetColor - specifies colour at the given location

  function GetColor(); virtual; abstract;

  

GetColor - finds the colour at the given location

  procedure SetHeight(); virtual; abstract;

  

SetHeight -sspecifies Canvas height

  function GetHeight; virtual; abstract;

  

GetHeight - returns the height of the Canvas

  procedure SetWidth(); virtual; abstract;

  

SetWidth - specifies the width of the Canvas

  function GetWidth; virtual; abstract;

  

GetWidth - returns the Width

  function GetClipRect; virtual;

  

GetClipRect - returns the coordinates of the rectangle used for clipping

  procedure SetClipRect(); virtual;

  

SetClipRect - specifies the rectangle to use for clipping

  function GetClipping; virtual;

  procedure SetClipping(); virtual;

  procedure SetPenPos(); virtual;

  

SetPenPos - specifies the position of the Pen

  procedure DoLockCanvas; virtual;

  

DoLockCanvas - method for locking the Canvas, making it impossible to change

  procedure DoUnlockCanvas; virtual;

  

DoUnlockCanvas - method for unlocking a previously locked Canvas

  procedure DoTextOut(); virtual; abstract;

  

DoTextOut - method for writing given text out at specified location

  procedure DoGetTextSize(); virtual; abstract;

  

DoGetTextSize - method for finding the size (stored as w: width, h: height) of the given text

  function DoGetTextHeight(); virtual; abstract;

  

DoGetTextHeight - returns the height of the given text

  function DoGetTextWidth(); virtual; abstract;

  

DoGetTextWidth - returns the width of the given text

  procedure DoRectangle(); virtual; abstract;

  

DoRectangle - method for drawing a rectangle in the given position

  procedure DoRectangleFill(); virtual; abstract;

  

DoRectangleFill - method for filling a rectagle in the given location

  procedure DoRectangleAndFill(); virtual;

  

DoRectangleAndFill - method for drawing a rectangle and filling it at the given location

  procedure DoEllipseFill(); virtual; abstract;

  

DoEllipseFill - method for filing an ellipse at the given location

  procedure DoEllipse(); virtual; abstract;

  

DoEllipse - method for drawing an ellipse at the given location

  procedure DoEllipseAndFill(); virtual;

  

DoEllipseAndFill - method for drawing an ellipse and filling it at the given location

  procedure DoPolygonFill(); virtual; abstract;

  

DoPolygonFill - method for filling a polygon at the given location (using supplied array of points)

  procedure DoPolygon(); virtual; abstract;

  

DoPolygon - method for drawing a polygon using the given array of points

  procedure DoPolygonAndFill(); virtual;

  

DoPolygonAndFill - method for drawing a polygon and filling it using the given array of points

  procedure DoPolyline(); virtual; abstract;

  

DoPolyline - method for drawing a PolyLine uing the given array of points

  procedure DoFloodFill(); virtual; abstract;

  

DoFloodFill - method for Flood-Filling an area strarting at the given location

  procedure DoMoveTo(); virtual;

  

DoMoveTo - method to move the drawing cursor to the specified point

  procedure DoLineTo(); virtual;

  

DoLineTo - method for drawing a line between the current cursor position and the specified point

  procedure DoLine(); virtual; abstract;

  

DoLine - method for drawing a line between two specified points

  procedure DoCopyRect(); virtual; abstract;

  

DoCopyRect - method to copy the source rectangle SourceRect to the specified position on another Canvas

  procedure DoDraw(); virtual; abstract;

  

DoDraw - method to draw the nominated Image at the specified location

  procedure CheckHelper(); virtual;

  

CheckHelper - method to ensure that a valid Helper has been called

  procedure AddHelper();

  

AddHelper - method to add a helper to the list

public

  constructor create;

  

create - constructor for TFPCustomCanvas. Performs inherited Create, creates helpers, sets up default sizes and pen, brush and font

  destructor destroy; override;

  

Destroy - destructor for TFPCustomCanvas: frees helpers and default pen, brush and font, then performs inherited Destroy

  procedure LockCanvas;

  

LockCanvas, ensuring no changes can be made

  procedure UnlockCanvas;

  

UnlockCanvas - frees a previously locked Canvas

  function Locked;

  

Returns True if Canvas is Locked

  function CreateFont;

  

CreateFont - returns a Font that has been created

  function CreatePen;

  

CreatePen - returns a Pen that has been created

  function CreateBrush;

  

CreateBrush - returns a Brush that has been created

  procedure TextOut();

  

Writes the Text string at the position X, Y on the canvas and leaves the pen at the end of the text

  procedure GetTextSize();

  

GetTextSize - finds the size (stored as w: width, h: height) of the specified text

  function GetTextHeight();

  

GetTextHeight - returns height of the specified text

  function GetTextWidth();

  

GetTextWidth - returns width of the specified text

  procedure Ellipse();

  

Ellipse - method to draw an ellipse to fit the given rectangle

  procedure EllipseC();

  

EllipseC - method to draw an ellipse given starting coordinates and radii for x- and y- directions

  procedure Polygon();

  

Method to draw a Polygon, ie a closed figure with the last point joined to the first

  procedure Polyline();

  

Method to draw a Polyline, ie a figure connecting the points in sequence, but not necessarily producing a closed figure

  procedure Rectangle();

  

Method to draw a Rectangle within the specified bounds, or given the limiting coordinates

  procedure FloodFill();

  

Method to FloodFill an area with colour, starting at the given point

  procedure Clear;

  

Method to Clear the Canvas

  procedure MoveTo();

  

Moves cursor to new position X1, Y1 without drawing anything

  procedure LineTo();

  

LineTo - draw a line between the current Pen position and the specified point

  procedure Line();

  

Draw a Line between the first and second points

  procedure CopyRect();

  

CopyRect - copies a rectangle from SourceRect to the specified position on a nominated Canvas

  procedure Draw();

  

Draw the nominated Image at the specified location

  procedure StretchDraw();

  

StretchDraw - steretch out the image being drawn to fit the supplied location and size

  procedure Erase; virtual;

  

Erase - clear away the drawing

  property LockCount: Integer; [r]

  property Font: TFPCustomFont; [rw]

  

The Font to be used for text in this Canvas

  property Pen: TFPCustomPen; [rw]

  

The Pen to be used for writing in this Canvas

  property Brush: TFPCustomBrush; [rw]

  

The Brush for the current Canvas

  property Interpolation: TFPCustomInterpolation; [rw]

  

The Interpolation algorithm to be used for connecting the indeterminate areas between specified points in an Image

  property Colors: TFPColor; [rw]

  

The Colors to be used for this Canvas

  property ClipRect: TRect; [rw]

  

ClipRect - the rectangle to be used for clipping

  property Clipping: Boolean; [rw]

  

If True, then Clippingis being applied to images on this Canvas

  property PenPos: TPoint; [rw]

  

PenPos - the current position of the Pen

  property Height: Integer; [rw]

  

The Height of the Canvas

  property Width: Integer; [rw]

  

The Width of the Canvas

  property ManageResources: Boolean; [rw]

  

ManageResources - if True, then resource management is being used

end;

Inheritance

TFPCustomCanvas

  

TFPCustomCanvas - FreePascal base class for Canvas

|

TPersistent

|

TObject

Description

TFPCustomCanvas - FreePascal base class for Canvas

Many of the methods are virtual and/or abstract; there is often no supplied code for the method, but the entries act as place-holders for programmers of descendant components to provide overriding methods

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