ResetTransform;
The ResetTransform method resets display options.
When the method is executed by axes, the scale equal to 1 (100%) will be set, the coordinate start point will be returned to the original position [0, 0].
Executing the example requires a form with the Button1 button and the ImageBox component named ImageBox1.
Add links to the Drawing system assembly.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
BMP: IGxBitmap;
Graph: IGxGraphics;
ImgFont: IGxFont;
ImgBrush: IGxBrush;
ImgFormat: IGxStringFormat;
Begin
BMP := GxBitmap.CreateNew(ImageBox1.ClientWidth, ImageBox1.ClientHeight, GxPixelFormat.Format24bppRgb);
ImgFont := New GxFont.Create("Times New Roman", 16, GxFontStyle.BoldItalic, GxUnit.World);
ImgBrush := New GxSolidBrush.Create(GxColor.FromName("Red"));
ImgFormat := New GxStringFormat.Create;
ImgFormat.Alignment := GxStringAlignment.Center;
Graph := GxGraphicsClass.FromImage(BMP);
Graph.SetScale(2, 2);
Graph.DrawTextF("Big text", ImgFont, ImgBrush, 30, 0, ImgFormat);
Graph.ResetTransform;
Graph.DrawTextF("Small text", ImgFont, ImgBrush, 50, 50, ImgFormat);
ImageBox1.Image := BMP;
End Sub Button1OnClick;
Clicking the button creates a new image. The scale is changed for the image and the text is displayed. After this the scale is restored and another text is added. The obtained image will be loaded to the ImageBox1 component.
See also: