TiObjectCanvas

Hierarchy Properties Methods Events

Unit

iObjectCanvas (VCL)

QiObjectCanvas (CLX)

Description

TiObjectCanvas is a basic canvas with an interface for adding persistent objects at runtime (Painting Persistence Only). All painting is handled automatically and is double-buffered to prevent flickering. The coordinate system is based on the Cartesian coordinate system with (0,0) corresponding to the center of the component. The X & Y range is set using the DisplayRangeX and DisplayRangeY property's.

IOCO0023.gif

Four basic drawing objects can be added to the canvas (Ellipse, Rectangle, Line, Text). There is no limitation to the number or types of basic objects that can be added. When one of the basic objects is added using the AddEllipse, AddRectangle, AddLine, or AddLabel methods, all property's of the object not specified in the parameters of the add method's are set according to the Default property settings. Store the handle of the object which is returned when calling one of the four add methods if you want to manipulate the object or change its property's. Once a object is added, any property of the object can be modified using the numerous get and set methods. The object type can also be changed dynamically at runtime if desired.

The last object added will have the highest z-order and will be shown on top. To manipulate the z-order at a later time, use the BringObjectToFront and SendObjectToBack methods.

To zoom-in or zoom-out, change the DisplayRangeX and DisplayRangeY property's. Both values must be adjust by the same percentage for proportional scaling.

To offset the drawing, use the OriginX and OriginY property's.

Use ClearList to remove all objects. Use RemoveObject to remove a single object. Use BeginUpdate and EndUpdate to improve performance when manipulating a large number of objects or to control the interval of repainting during animations.

Contents | Index | Previous | Next