FillRectangleF(Brush: IGxBrush; Rect: IGxRectF);
Brush. Brush.
Rect. Real rectangle to be filled.
The FillRectangleF method fills real rectangle with brush sent in the Brush parameter.
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: 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.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Report;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
BmpCls: GxBitmapClass = New GxBitmapClass();
Bmp: GxBitmap;
GraphCls: GxGraphicsClass = New GxGraphicsClassClass();
Graph: GxGraphics;
Rect: GxRect = New GxRectClass();
ColorCls: GxColorClass = New GxColorClassClass();
Color: GxColor;
Brush: GxSolidBrush = New GxSolidBrushClass();
RectF: GxRectF = New GxRectFClass();
Picture: IPrxPicture;
DpiX, DpiY: Double;
Begin
Bmp := BmpCls.CreateNew(200, 100, GxPixelFormat.pifFormat32bppArgb);
Graph := GraphCls.FromImage(Bmp);
//Create a rectangle, color and brush
RectF.Create(0, 0, 200.15, 200.15);
Color := ColorCls.FromKnownColor(GxKnownColor.clYellow);
Brush.Create(Color);
// Fills rectangle with defined brush
Graph.FillRectangleF(Brush, RectF);
RectF.Create(5, 5, 5, 5);
Picture := uiTabSheetNet1.TabSheetUi.TabSheet.Objects.Add("PrxPicture", RectF) As IPrxPicture;
Picture.AutoSize := True;
Picture.Image := BMP;
// Displays horizontal and vertical resolution
DpiX := Graph.DpiX;
DpiY := Graph.DpiY;
System.Diagnostics.Debug.WriteLine("DpiX: " + DpiX.ToString());
System.Diagnostics.Debug.WriteLine("DpiY: " + DpiY.ToString());
End Sub;
See also: