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 As Integer, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Integer, _
ByVal As Boolean _
) As GdPictureStatus
public GdPictureStatus DrawFilledCircle(
int ,
float ,
float ,
float ,
int ,
bool
)
public function DrawFilledCircle(
: Integer;
: Single;
: Single;
: Single;
: Integer;
: Boolean
): GdPictureStatus;
public function DrawFilledCircle(
: int,
: float,
: float,
: float,
: int,
: boolean
) : GdPictureStatus;
public: GdPictureStatus DrawFilledCircle(
int ,
float ,
float ,
float ,
int ,
bool
)
public:
GdPictureStatus DrawFilledCircle(
int ,
float ,
float ,
float ,
int ,
bool
)
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.
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);
}
Example
Drawing a filled circle.
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);
}
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