GdPicture14 Namespace
/
GdPictureImaging Class
/
DrawBezier Method
/ DrawBezier(Int32,Single,Single,Single,Single,Single,Single,Single,Single,Single,Int32,Boolean) Method
DrawBezier(Int32,Single,Single,Single,Single,Single,Single,Single,Single,Single,Int32,Boolean) Method
In This Topic
Draws a bezier spline on a GdPicture image. The drawing color is specified with an integer value.
Syntax
'Declaration
Public Overloads Function DrawBezier( _
ByVal As Integer, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Integer, _
ByVal As Boolean _
) As GdPictureStatus
public GdPictureStatus DrawBezier(
int ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
int ,
bool
)
public function DrawBezier(
: Integer;
: Single;
: Single;
: Single;
: Single;
: Single;
: Single;
: Single;
: Single;
: Single;
: Integer;
: Boolean
): GdPictureStatus;
public function DrawBezier(
: int,
: float,
: float,
: float,
: float,
: float,
: float,
: float,
: float,
: float,
: int,
: boolean
) : GdPictureStatus;
public: GdPictureStatus DrawBezier(
int ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
int ,
bool
)
public:
GdPictureStatus DrawBezier(
int ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
float ,
int ,
bool
)
Parameters
- ImageID
- GdPicture image identifier.
- Left1
- Specifies the x-coordinate of the starting point of the Bezier spline.
- Top1
- Specifies the y-coordinate of the starting point of the Bezier spline.
- Left2
- Specifies the x-coordinate of the first control point of the Bezier spline.
- Top2
- Specifies the y-coordinate of the first control point of the Bezier spline.
- Left3
- Specifies the x-coordinate of the second control point of the Bezier
spline.
- Top3
- Specifies the y-coordinate of the second control point of the Bezier
spline.
- Left4
- Specifies the x-coordinate of the ending point of the Bezier spline.
- Top4
- Specifies the y-coordinate of the ending point of the Bezier spline.
- PenWidth
- The width, in pixel, of the pen used to draw the arc.
- PenColor
- Color of the Bezier spline. 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 red circle approximation using four Bezier curves on a png image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("input.png");
// Draw a circle approximation.
gdpictureImaging.DrawBezier(imageID, 100, 50, 127, 50, 150, 73, 150, 100, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.DrawBezier(imageID, 150, 100, 150, 127, 127, 150, 100, 150, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.DrawBezier(imageID, 100, 150, 73, 150, 50, 127, 50, 100, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.DrawBezier(imageID, 50, 100, 50, 73, 73, 50, 100, 50, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.SaveAsPNG(imageID, "output.png");
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
Example
Drawing a red circle approximation using four Bezier curves on a png image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("input.png");
// Draw a circle approximation.
gdpictureImaging.DrawBezier(imageID, 100, 50, 127, 50, 150, 73, 150, 100, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.DrawBezier(imageID, 150, 100, 150, 127, 127, 150, 100, 150, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.DrawBezier(imageID, 100, 150, 73, 150, 50, 127, 50, 100, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.DrawBezier(imageID, 50, 100, 50, 73, 73, 50, 100, 50, 1, gdpictureImaging.ARGBI(255, 255, 0, 0), true);
gdpictureImaging.SaveAsPNG(imageID, "output.png");
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also