Class TAdCanvas

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TAdCanvas = class(TObject)

Description

TAdCanvas is a hardware accelerated canvas object, that may perform the most comon graphic operations in high speed. Remember that more specialiced functions of Andorra 2D are even faster than TAdCanvas. So if you e.g. only want to draw a image, use TAdImage instead.

Hierarchy

Overview

Methods

Public constructor Create(AAppl:TAd2dApplication);
Public destructor Destroy; override;
Public procedure StartFrame;
Public procedure EndFrame;
Public procedure Release;
Public function ReturnDisplayList:TAdCanvasDisplayList;
Public procedure DrawObject(var AObj:TAdCanvasObject);
Public procedure MoveTo(ax,ay:integer); overload;
Public procedure LineTo(ax,ay:integer); overload;
Public procedure MoveTo(ap:TAdPoint); overload;
Public procedure LineTo(ap:TAdPoint); overload;
Public procedure Line(ax1,ay1,ax2,ay2:integer); overload;
Public procedure Line(ap1,ap2:TAdPoint); overload;
Public procedure SplineMoveTo(ax, ay: integer); overload;
Public procedure SplineMoveTo(ap: TAdPoint); overload;
Public procedure SplineLineTo(ax, ay: integer); overload;
Public procedure SplineLineTo(ap: TAdPoint); overload;
Public procedure Arrow(ArrowSize, ArrowAngle:Integer; P1, P2:TAdPoint);
Public procedure TextOut(AX, AY:integer; AText:string); overload;
Public procedure Rectangle(AX1, AY1, AX2, AY2:integer); overload;
Public procedure Rectangle(AR:TAdRect); overload;
Public procedure Rectangle(AP1, AP2:TAdPoint); overload;
Public procedure Rectangle(AP:TAdPoint; AWidth, AHeight:integer); overload;
Public procedure PlotPixel(AX, AY:integer); overload;
Public procedure PlotPixel(AX, AY:integer; AColor:TAndorraColor); overload;
Public procedure Ellipse(AX1, AY1, AX2, AY2:integer);
Public procedure Circle(ACX, ACY, AR:integer);
Public procedure DrawColoredQuad(AQuad:TAdCanvasColorQuad);
Public procedure DrawQuad(AQuad:TAdCanvasQuad);
Public procedure Polygon(APolygon:TAdPolygon);
Public procedure Polyline(APolygon: TAdPolygon);
Public procedure Spline(ASpline: TAdPolygon);

Properties

Public property Pen: TAdPen read FPen write FPen;
Public property Brush: TAdBrush read FBrush write FBrush;
Public property Font: TAdFont read FFont write FFont;
Public property OnRelease: TAdNotifyEvent read FOnRelease write FOnRelease;
Public property OnBeginFrame: TAdNotifyEvent read FOnBeginFrame write FOnBeginFrame;
Public property OnEndFrame: TAdNotifyEvent read FOnEndFrame write FOnEndFrame;

Description

Methods

Public constructor Create(AAppl:TAd2dApplication);

Creates an instance of TAdCanvas.

Public destructor Destroy; override;

Destroys an instance of TAdCanvas.

Public procedure StartFrame;

Does some preparations which have to be done at the beginning of a frame. Normally this function is automatically called by TAdRenderingSurface.

Public procedure EndFrame;

Finalizes the frame, does some memory-cleanup and calles release. Normally this function is automatically called by TAdRenderingSurface.

Public procedure Release;

The "Release" procedure draws the objects which are in the current display list and creates a new display list.

See also
ReturnDisplayList
Returns the current display list without drawing and creates a new display list.
Public function ReturnDisplayList:TAdCanvasDisplayList;

Returns the current display list without drawing and creates a new display list. Use ReturnDisplay list if you want to draw objects aside from TAdCanvas and without calling the draw functions each time.

See also
Release
The "Release" procedure draws the objects which are in the current display list and creates a new display list.
TAdCanvasDisplayList
Contains multiple TAdCanvasObject objects.
Public procedure DrawObject(var AObj:TAdCanvasObject);

Draws the specified canvas object.

Public procedure MoveTo(ax,ay:integer); overload;

Moves the start point of the line to the specified coordinates.

See also
LineTo
Draws a line from the start point specified by "MoveTo" to the specified coordinates.
Line
Draws a line from the start point to the specified coordinates.
Public procedure LineTo(ax,ay:integer); overload;

Draws a line from the start point specified by "MoveTo" to the specified coordinates.

See also
MoveTo
Moves the start of the line to the specified coordinates.
Line
Draws a line from the start point to the specified coordinates.
Public procedure MoveTo(ap:TAdPoint); overload;

Moves the start of the line to the specified coordinates.

See also
LineTo
Draws a line from the start point specified by "MoveTo" to the specified coordinates.
Line
Draws a line from the start point to the specified coordinates.
Public procedure LineTo(ap:TAdPoint); overload;

Draws a line from the start point specified by "MoveTo" to the specified coordinates.

See also
MoveTo
Moves the start of the line to the specified coordinates.
Line
Draws a line from the start point to the specified coordinates.
Public procedure Line(ax1,ay1,ax2,ay2:integer); overload;

Draws a line from the start point to the specified coordinates.

See also
MoveTo
Moves the start of the line to the specified coordinates.
Line
Draws a line from the start point to the specified coordinates.
Public procedure Line(ap1,ap2:TAdPoint); overload;

Draws a line from the start point to the specified coordinates.

See also
MoveTo
Moves the start of the line to the specified coordinates.
Line
Draws a line from the start point to the specified coordinates.
Public procedure SplineMoveTo(ax, ay: integer); overload;

Moves the start point of the line to the specified coordinates.

Public procedure SplineMoveTo(ap: TAdPoint); overload;

Moves the start point of the line to the specified coordinates.

Public procedure SplineLineTo(ax, ay: integer); overload;

Draws a spline from the start point specified by "SplineMoveTo" to the specified coordinates.

Public procedure SplineLineTo(ap: TAdPoint); overload;

Draws a spline from the start point specified by "SplineMoveTo" to the specified coordinates.

Public procedure Arrow(ArrowSize, ArrowAngle:Integer; P1, P2:TAdPoint);

Draws an arrow from P1 to P2. ArrowSize specifies the length of the a rrowhead. ArrowAngle specifies the inner angle between the to arrowhead lines.

Public procedure TextOut(AX, AY:integer; AText:string); overload;

Draws a text using the font specified in the "Font" property.

Public procedure Rectangle(AX1, AY1, AX2, AY2:integer); overload;

Draws a rectangle.

Public procedure Rectangle(AR:TAdRect); overload;

Draws a rectangle.

Public procedure Rectangle(AP1, AP2:TAdPoint); overload;

Draws a rectangle.

Public procedure Rectangle(AP:TAdPoint; AWidth, AHeight:integer); overload;

Draws a rectangle.

Public procedure PlotPixel(AX, AY:integer); overload;

Draws a single pixel using the color specified in TAdPen.Color

Public procedure PlotPixel(AX, AY:integer; AColor:TAndorraColor); overload;

Draws a single pixel using the color specified in the "AColor" parameter.

Public procedure Ellipse(AX1, AY1, AX2, AY2:integer);

Draws an ellipse within the specified coordinates.

Public procedure Circle(ACX, ACY, AR:integer);

Draws a circle with the center "acx;acy" and the readius "ar".

Public procedure DrawColoredQuad(AQuad:TAdCanvasColorQuad);

Draws a colored quad. .

See also
TAdCanvasColorQuad
Represents the four positions of a quad with the correspondenting colors.
Public procedure DrawQuad(AQuad:TAdCanvasQuad);

Draws a simple quad using the color specified in "Brush".

See also
TAdCanvasQuad
Represents the four positions of a quad.
TAdBrush
Class which defines the look of the brush of the canvas.
Public procedure Polygon(APolygon:TAdPolygon);

Draws a simple polygon. The polygon points have to be in clockwise order and may not contain any intersections.

Public procedure Polyline(APolygon: TAdPolygon);

Draws a poly line.

Public procedure Spline(ASpline: TAdPolygon);

Draws a spline.

Properties

Public property Pen: TAdPen read FPen write FPen;

The pen object, which represents the settings for the outline of the objects.

See also
TAdPen
A class which defines the settings of the outer line of a canvas object.
Public property Brush: TAdBrush read FBrush write FBrush;

The brush object, which represents the settings for the filling of the objects.

See also
TAdBrush
Class which defines the look of the brush of the canvas.
Public property Font: TAdFont read FFont write FFont;

Set the "Font" property to the font you would like to use with "TextOut".

Public property OnRelease: TAdNotifyEvent read FOnRelease write FOnRelease;

This event triggered, when the "release" method of TAdCanvas is called. "OnRelease" is used internally by TAdRenderingSurface. When the release method of its own canvas is called, TAdRenderingSurface automatically sets itself to the current active surfacre.

See also
TAdCanvas.Release
The "Release" procedure draws the objects which are in the current display list and creates a new display list.
Public property OnBeginFrame: TAdNotifyEvent read FOnBeginFrame write FOnBeginFrame;

The "OnBeginFrame" event is triggered, when the "BeginFrame" method of TAdCanvas is called.

Public property OnEndFrame: TAdNotifyEvent read FOnEndFrame write FOnEndFrame;

The "OnEndFrame" event is triggered, when the "EndFrame" method of TAdCanvas is called.

SourceForge.net Logo


Generated by PasDoc 0.11.0 on 2008-12-31 14:31:58