GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / DrawFilledRectangle Method / DrawFilledRectangle(Int32,Single,Single,Single,Single,GdPictureColor,Boolean) Method
GdPicture image identifier.
Specifies the x-coordinate of the upper-left corner of the rectangle.
Specifies the y-coordinate of the upper-left corner of the rectangle.
Specifies the width of the rectangle.
Specifies the height of the rectangle.
Color of the filled rectangle. A suitable color value can be obtained by using the ARGB() method.
Set to True to apply the Antialiasing algorithm else False.
Example





In This Topic
DrawFilledRectangle(Int32,Single,Single,Single,Single,GdPictureColor,Boolean) Method
In This Topic
Draws a filled rectangle on a GdPicture image.
Syntax
'Declaration
 
Public Overloads Function DrawFilledRectangle( _
   ByVal ImageID As Integer, _
   ByVal DstLeft As Single, _
   ByVal DstTop As Single, _
   ByVal Width As Single, _
   ByVal Height As Single, _
   ByVal FillColor As GdPictureColor, _
   ByVal AntiAlias As Boolean _
) As GdPictureStatus
public GdPictureStatus DrawFilledRectangle( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Width,
   float Height,
   GdPictureColor FillColor,
   bool AntiAlias
)
public function DrawFilledRectangle( 
    ImageID: Integer;
    DstLeft: Single;
    DstTop: Single;
    Width: Single;
    Height: Single;
    FillColor: GdPictureColor;
    AntiAlias: Boolean
): GdPictureStatus; 
public function DrawFilledRectangle( 
   ImageID : int,
   DstLeft : float,
   DstTop : float,
   Width : float,
   Height : float,
   FillColor : GdPictureColor,
   AntiAlias : boolean
) : GdPictureStatus;
public: GdPictureStatus DrawFilledRectangle( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Width,
   float Height,
   GdPictureColor FillColor,
   bool AntiAlias
) 
public:
GdPictureStatus DrawFilledRectangle( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Width,
   float Height,
   GdPictureColor FillColor,
   bool AntiAlias
) 

Parameters

ImageID
GdPicture image identifier.
DstLeft
Specifies the x-coordinate of the upper-left corner of the rectangle.
DstTop
Specifies the y-coordinate of the upper-left corner of the rectangle.
Width
Specifies the width of the rectangle.
Height
Specifies the height of the rectangle.
FillColor
Color of the filled rectangle. A suitable color value can be obtained by using the ARGB() method.
AntiAlias
Set to True to apply the Antialiasing algorithm else False.

Return Value

A member of the GdPictureStatus enumeration.
Remarks

This method requires the Image Documents component to run.

Example
Filling a 150x100 pixels red rectangle with a top left corner at 200,100.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int top = 100, left = 200, width = 150, height = 100;
    int imageID = gdpictureImaging.CreateNewGdPictureImage(400, 400, System.Drawing.Imaging.PixelFormat.Format24bppRgb, Color.White);
 
    // Fill the rectangle. The AntiAlias parameter is set to true to apply antialiasing algorithm, i.e. to improve the appearance of the rectangle boundary.
    gdpictureImaging.DrawFilledRectangle(imageID, left, top, width, height, Color.Red, true);
 
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also