DrawLine method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int DrawLine (int iX1, int iY1, int iX2, int iY2);

Delphi Syntax

DrawLine (iX1, iY1, iX2, iY2:Integer): Integer;

Overview

Refer to Drawing Simple Objects.

Remarks

Draws a line on the screen or on the bitmap. The DrawPersistence property determines whether the object is drawn on the screen or the bitmap.

Whether you draw to the screen or to the bitmap, drawing objects are always positioned in the Main Control's client area. If the target is the bitmap, LEADTOOLS translates the values to bitmap coordinates.

If the DrawPersistence property is TRUE, all drawing is done on the bitmap, not the screen. In this case this method supports 1, 4, 8 palettized, 16 and 24-bit color images. Therefore, to call this method for an image of some other bits per pixel, or a 12 or 16-bit grayscale image, the ColorRes method must be called first to convert that image to a 1, 4, 8 palettized, 16 or 24-bit color image.

If the DrawPersistence property is FALSE, then all drawing is done to the screen. In this case images of all bits per pixel values can be used by this method.

See Also

Topics:

Working with the Control: Client Area Usage

 

Raster Images: Drawing on a Bitmap