Image Component and Canvas


Creating an Image Component

Select the image icon from the Additional Tab on the component bar. Then place the image and shape to desired size. One common choice for placement of the image is to use the align property (in the Object Inspector) alClient. This makes the image the whole size of the form containing it. This form can be the main form or a pannel in a form. Click here to see a vidio of this process.


A complete description of TCanvas can be found in the Builder Help Index under Canvas Component. The methods and properties described there are fairly self-explanatory. One point that many miss that to draw a line, you first must MoveTo one endpoint then use LineTo the other endpoint to draw the line.

TCanvas provides an abstract drawing space for objects that must render their own images.




Use TCanvas as a drawing surface for objects that draw an image of themselves. Standard window controls such as edit controls or list boxes do not require a canvas, as they are drawn by Windows.

TCanvas provides properties, events and methods that assist in creating an image by

TCanvas has two descendants, TControlCanvas and TMetafileCanvas, which assist in drawing images of controls and in creating metafile images for objects.