DrawTextStr method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int DrawTextStr (System::AnsiString Str, LEADTyp::TBitmapHandle ForegroundImage);

Delphi Syntax

DrawTextStr (System::AnsiString Str, ForegroundImage: TBitmapHandle): Integer;

Overview

Refer to Drawing Three-Dimensional Shapes and Text.

Remarks

Draws a text object in the control's client area or on the current bitmap. Placement and other aspects of the text object are specified by related properties described in Drawing Three-Dimensional Shapes and Text.

You can create an image that consists of a pattern or gradient color to use as a foreground of the text. Refer to Gradients and Patterns for related properties.

The bitmap that you specify is positioned at the origin of the text object's rectangle, and it is not scaled. Therefore the bitmap that you use for this purpose should be sized accordingly. In most cases it should be the same size as the rectangle.

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