Fills the interior of a rectangle that has the specified dimensions and the specified brush.
brush
The brush used to fill the rectangle's interior.
x
The x-coordinate of the upper-left corner of the rectangle to draw.
y
The y-coordinate of the upper-left corner of the rectangle to draw.
width
Width of the rectangle to draw.
height
Height of the rectangle to draw.
FillRectangle(Brush,float,float,float,float) fills the interior of a rectangle with the specified brush.
using Leadtools.Windows.D2DRendering;public void D2DSurfaceExample(){//Create a new instance of the D2DSurface objectD2DSurface d2dSurface = new D2DSurface();//Set the surface Sized2dSurface.SurfaceSize = new Size(1000, 1000);//Pass an empty rect to redraw the entire surfaced2dSurface.BeginDraw(Rect.Empty);//Save the surface drawing stateD2DDrawingState drawingState = d2dSurface.Save();//Create a rect having the specified dimensionsRect rect = new Rect(40, 40, 500, 200);//Create a new instance of a brush from a new solid color brushBrush fill = new SolidColorBrush(Colors.Green);//Fill the interior of the specified rectangle using the specified brushd2dSurface.FillRectangle(fill, rect);//Create a new instance of the D2DPen objectD2DPen pen = new D2DPen(new SolidColorBrush(Colors.Red), 2);//Draw an outline using the specified rectangle and D2DPend2dSurface.DrawRectangle(pen, rect);//Restore the surface drawing stated2dSurface.Restore(drawingState);//End the Draw operation and invalidate the surfaced2dSurface.EndDraw();d2dSurface.Invalidate(Rect.Empty);}