IGxGraphics.FillRectangle

Syntax

FillRectangle(Brush: IGxBrush; Rect: IGxRect);

Parameters

Brush. Brush.

Rect. Integer rectangle to be filled.

Description

The FillRectangle method fills the integer rectangle with the brush passed by the Brush parameter.

Example

Executing the example requires a form with the button named Button1, the UiTabSheet1 non-visual component named UiTabSheet1, the TabSheetBox1 component named TabSheetBox1. Add links to the Drawing, Report, Tab system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    BMP: IGxBitmap;
    Graph: IGxGraphics;
    Brush: IGxBrush;
    Color: IGxColor;
    Rect: IGxRect;
    Picture: IPrxPicture;
Begin
    BMP := GxBitmap.CreateNew(200,100,GxPixelFormat.Format32bppArgb);
    Graph:= GxGraphicsClass.FromImage(BMP);
    // Create a rectangle, color and brush
    Rect := New GxRect.Create(0,0,200,200);
    Color := GxColor.FromKnownColor(GxKnownColor.Yellow);
    Brush := New GxSolidBrush.Create(Color);
    // Fills rectangle with the specified brush and sets high quality image
    Graph.FillRectangle(Brush,Rect);

    Graph.SmoothingMode := GxSmoothingMode.HighQuality;
    Picture := TabSheetBox1.Source.GetTabSheet.Objects.Add("PrxPicture"New GxRectF.Create(5,5,5,5)) As IPrxPicture;
    Picture.AutoSize := True;
    Picture.Image := BMP;
End Sub Button1OnClick;

Clicking the button in the TabSheetBox1 component renders yellow rectangle in the top left angle.

See also:

IGxGraphics