IGxGraphics.DrawTextW

Syntax

DrawTextW(Text: String; Font: IGxFont; Brush: IGxBrush; X: Double, Y: Double);

Parameters

Text. Text.

Font. Font that is used to display the text.

Brush. Brush that is used to render the text.

X. The X real coordinate of the point where the text is displayed.

Y. The Y real coordinate of the point where the text is displayed.

Description

The DrawTextW method displays text with the specified brush and font in the point with the X and Y coordinates.

Fore Example

Executing the example requires a form with the button named Button1 and the ImageBox component named ImageBox1. Add links to the Drawing, Forms system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

BMP: IGxBitmap;

Graph: IGxGraphics;

GraphClass: GxGraphicsClass;

Font: IGxFont;

Brush: IGxBrush;

Begin

BMP := GxBitmap.CreateNew(ImageBox1.ClientWidth, ImageBox1.ClientHeight, GxPixelFormat.Unknown);

Font := New GxFont.Create("Times New Roman", 16, GxFontStyle.BoldItalic, GxUnit.World);

Brush := New GxSolidBrush.Create(GxColor.FromName("Red"));

GraphClass := New GxGraphics.Create;

Graph := GraphClass.FromImage(BMP);

Graph.DrawTextW("PROGNOZ", Font, Brush, 10, 10);

ImageBox1.Image := BMP;

End Sub Button1OnClick;

After executing the example clicking the button in the ImageBox component displays a new bitmap where the "PROGNOZ" label is rendered according to the specified settings.

See also:

IGxGraphics