TIvoryCanvas
Version 1.0 Beta 2

The drawing area of the surface.


Description

TIvoryCanvas provides a drawing area on which you can draw using GDI functions.

For a beginner, it's not easy to understand the difference between TIvoryDraw, TIvorySurface, and TIvoryCanvas. They're all invisible components, and together represent an interface to DirectDraw.

TIvorySurface is a wrapper around the TDirectDrawSurface object, which represents a DirectDraw surface. A DirectDraw surface is just a buffer in the memory or in the video memory. Anything you draw on a surface can be shown on the screen.

TIvoryCanvas is a wrapper around GDI (Graphics Driver Interface). TIvoryCanvas is much like VCL object TCanvas. TIvoryCanvas also provides drawing functions like MoveTo, LineTo, or TextOut. But TIvoryCanvas is not a descandant of TCanvas, because a DirectDraw application works a bit different than standard Windows applications; I couldn't use TCanvas, I needed to write my own canvas object, which is very much like TCanvas. Therefore I haven't documented all the methods of TIvoryCanvas. You can find the undocumented members in the online help. Just search for the keyword TCanvas.

There is one thing you should keep in mind: You can only draw on a surface in the OnPaint event handler of the surface. Do not call any member functions of TIvoryCanvas outside the OnPaint event handler.

The OnChange event is used by the IvorySurface component. So if the TIvoryCanvas object is the Canvas property of a TIvorySurface, do not use the OnChange event of the canvas.

Hierarchy

TObjectTPersistentTIvoryCanvas

Properties
Brush
Font
Handle
Pen

Methods
~TIvoryCanvas
Arc
Chord
Draw
DrawFocusRect
Ellipse
FillRect
FloodFill
FrameRect
LineTo
MoveTo
Pie
Rectangle
RoundRect
StretchDraw
TextHeight
TextOut
TextRect
TextWidth
TileDraw
TIvoryCanvas

Events
OnChange
OnChanging


Back to the Ivory Draw page