DrawRectangle method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int DrawRectangle (int iLeft, int iTop, int iWidth, int iHeight);

Delphi Syntax

DrawRectangle (iLeft, iTop, iWidth, iHeight: Integer): Integer;

Overview

Refer to Drawing Simple Objects.

Remarks

Draws a rectangle 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