GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / DrawFilledCircle Method / DrawFilledCircle(Int32,Single,Single,Single,Int32,Boolean) Method
GdPicture image identifier.
Specifies the x-coordinate of the center of the circle.
Specifies the y-coordinate of the center of the circle.
Diameter of the circle in pixel.
Color of the filled circle. A suitable color value can be obtained by using the ARGBI() method.
Set to True to apply the Antialiasing algorithm else False.
Example





In This Topic
DrawFilledCircle(Int32,Single,Single,Single,Int32,Boolean) Method
In This Topic
Draws a filled circle on a GdPicture image. The filling color is specified with an integer value.
Syntax
'Declaration
 
Public Overloads Function DrawFilledCircle( _
   ByVal ImageID As Integer, _
   ByVal DstLeft As Single, _
   ByVal DstTop As Single, _
   ByVal Diameter As Single, _
   ByVal FillColor As Integer, _
   ByVal AntiAlias As Boolean _
) As GdPictureStatus
public GdPictureStatus DrawFilledCircle( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Diameter,
   int FillColor,
   bool AntiAlias
)
public function DrawFilledCircle( 
    ImageID: Integer;
    DstLeft: Single;
    DstTop: Single;
    Diameter: Single;
    FillColor: Integer;
    AntiAlias: Boolean
): GdPictureStatus; 
public function DrawFilledCircle( 
   ImageID : int,
   DstLeft : float,
   DstTop : float,
   Diameter : float,
   FillColor : int,
   AntiAlias : boolean
) : GdPictureStatus;
public: GdPictureStatus DrawFilledCircle( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Diameter,
   int FillColor,
   bool AntiAlias
) 
public:
GdPictureStatus DrawFilledCircle( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Diameter,
   int FillColor,
   bool AntiAlias
) 

Parameters

ImageID
GdPicture image identifier.
DstLeft
Specifies the x-coordinate of the center of the circle.
DstTop
Specifies the y-coordinate of the center of the circle.
Diameter
Diameter of the circle in pixel.
FillColor
Color of the filled circle. A suitable color value can be obtained by using the ARGBI() 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
Drawing a filled circle.
Rendering an image with a circle onto the background image and saving the result into a png file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int backColor = gdpictureImaging.ARGBI(255, 0, 255, 0); // Green color
    int circleColor = gdpictureImaging.ARGBI(255, 255, 0, 0); // Red color
 
    // Create a background image.
    int backImage = gdpictureImaging.CreateNewGdPictureImage(320, 200, 32, backColor);
 
    // Create an image used for drawing, and draw a circle on it.
    int circleImage = gdpictureImaging.CreateNewGdPictureImage(80, 80, 32, gdpictureImaging.ARGBI(0, 0, 0, 0));
    gdpictureImaging.DrawFilledCircle(circleImage, 40, 40, 60, circleColor, false);
 
    // Draw an image with a circle onto the background image.
    gdpictureImaging.DrawGdPictureImage(circleImage, backImage, 0, 0, 80, 80, System.Drawing.Drawing2D.InterpolationMode.Default);
    gdpictureImaging.SaveAsPNG(backImage, "output.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(circleImage);
    gdpictureImaging.ReleaseGdPictureImage(backImage);
}
Filling a green circle with a center at 200, 250 and a diameter of 100 pixels.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int centerX = 200, centerY = 250, diameter = 100;
    int imageID = gdpictureImaging.CreateNewGdPictureImage(400, 400, System.Drawing.Imaging.PixelFormat.Format24bppRgb, gdpictureImaging.ARGBI(0, 0, 0, 0));
 
    // Fill the circle. The AntiAlias parameter is set to true to apply antialiasing algorithm, i.e. to improve the appearance of the circle boundary.
    gdpictureImaging.DrawFilledCircle(imageID, centerX, centerY, diameter, gdpictureImaging.ARGBI(255, 0, 255, 0), true);
 
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also