DrawFilledCircle(Int32,Single,Single,Single,GdPictureColor,Boolean) Method
In This Topic
Draws a filled circle on a GdPicture image.
Syntax
'Declaration
Public Overloads Function DrawFilledCircle( _
ByVal As Integer, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As GdPictureColor, _
ByVal As Boolean _
) As GdPictureStatus
public GdPictureStatus DrawFilledCircle(
int ,
float ,
float ,
float ,
GdPictureColor ,
bool
)
public function DrawFilledCircle(
: Integer;
: Single;
: Single;
: Single;
: GdPictureColor;
: Boolean
): GdPictureStatus;
public function DrawFilledCircle(
: int,
: float,
: float,
: float,
: GdPictureColor,
: boolean
) : GdPictureStatus;
public: GdPictureStatus DrawFilledCircle(
int ,
float ,
float ,
float ,
GdPictureColor ,
bool
)
public:
GdPictureStatus DrawFilledCircle(
int ,
float ,
float ,
float ,
GdPictureColor ,
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 circle. 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.
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())
{
Color backColor = gdpictureImaging.ARGB(255, 0, 255, 0); // Green color
Color circleColor = gdpictureImaging.ARGB(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.ARGB(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, Color.White);
// 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, Color.Green, true);
gdpictureImaging.SaveAsPNG(imageID, "output.png");
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
Example
Drawing a filled circle.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
Color backColor = gdpictureImaging.ARGB(255, 0, 255, 0); // Green color
Color circleColor = gdpictureImaging.ARGB(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.ARGB(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, Color.White);
// 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, Color.Green, true);
gdpictureImaging.SaveAsPNG(imageID, "output.png");
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also