Background: IGxImage;
The Background property determines the background image of the component.
Executing the example requires a form, the ImageButton component named ImageButton1 positioned on it.
Sub ImageButton1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Img: IGxImage;
TransfImage: IGxRectangleTransformImage;
Marg: IGxMargins;
Begin
Img := GxRectangleTransformImage.FromFile("c:\Image.bmp");
TransfImage := Img As IGxRectangleTransformImage;
Marg := TransfImage.Margins;
Marg.Bottom := 5;
Marg.Left := 5;
Marg.Right := 5;
Marg.Top := 5;
TransfImage.Unit := GxUnit.Millimeter;
ImageButton1.NormalLook.Background := TransfImage;
End Sub ImageButton1OnClick;
After executing the example pressing the ImageButton1 button changes the background for it. The Image.bmp image is set as a background in the standard mode of the button. The fixed area is set for the image -five millimeters from all edges.
See also: