IImageButtonLook.Background

Syntax

Background: IGxImage;

Description

The Background property determines a background image of the component.

Example

Executing the example requires a form and the ImageButton component named ImageButton1 on the form.

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, clicking the ImageButton1 button changes its background. The Image.bmp image is set as a background in the standard mode of the button. The fixed area of five millimeters from all edges is set for the image.

See also:

IImageButtonLook