IGxGraphics.FillRectangleF

Syntax

FillRectangleF(Brush: IGxBrush; Rect: IGxRectF);

Parameters

Brush. Brush.

Rect. Real rectangle to be filled.

Description

The FillRectangleF method fills real rectangle with brush sent in the Brush parameter.

Example

Executing the example requires a form with a 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: IGxRectF;
    Picture: IPrxPicture;
    DpiX, DpiY: Double;
Begin
    BMP := GxBitmap.CreateNew(200,100,GxPixelFormat.Format32bppArgb);
    Graph:= GxGraphicsClass.FromImage(BMP);
    // Create a rectangle, color and brush
    Rect := New GxRectF.Create(0,0,200.15,200.15);
    Color := GxColor.FromKnownColor(GxKnownColor.Yellow);
    Brush := New GxSolidBrush.Create(Color);
    // Fills rectangle with defined brush
    Graph.FillRectangleF(Brush,Rect);
    Picture := TabSheetBox1.Source.GetTabSheet.Objects.Add("PrxPicture"New GxRectF.Create(5,5,5,5)) As IPrxPicture;
    Picture.AutoSize := True;
    Picture.Image := BMP;
    // Displays horizontal and vertical resolution
    DpiX := Graph.DpiX;
    DpiY := Graph.DpiY;
    Debug.WriteLine("DpiX: " + DpiX.ToString);
    Debug.WriteLine("DpiY: " + DpiY.ToString);
End Sub Button1OnClick;

Clicking the button in the TabSheetBox1 component renders the yellow rectangle at the top left corner, the console window displays horizontal and vertical values of graphic object resolution.

See also:

IGxGraphics