ToBitmap: IGxBitmap;
The ToBitmap method transforms the icon to a bitmap.
Executing the example requires a form with the Button1 button and the ImageBox component named ImageBox1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Icon: IGxIcon;
Begin
Icon := Self.Icon;
If Not IsNull(Icon) Then
ImageBox1.Image := Icon.ToBitmap;
Debug.WriteLine("Width: " + Icon.Width.ToString);
Debug.WriteLine("Height: " + Icon.Height.ToString);
End If;
End Sub Button1OnClick;
On clicking the button, if an icon is set for the form, its image is loaded to the ImageBox1 component, and size is displayed in the development environment console.
See also: