GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / DrawBezier Method / DrawBezier(Int32,Single,Single,Single,Single,Single,Single,Single,Single,Single,Int32,Boolean) Method
GdPicture image identifier.
Specifies the x-coordinate of the starting point of the Bezier spline.
Specifies the y-coordinate of the starting point of the Bezier spline.
Specifies the x-coordinate of the first control point of the Bezier spline.
Specifies the y-coordinate of the first control point of the Bezier spline.
Specifies the x-coordinate of the second control point of the Bezier spline.
Specifies the y-coordinate of the second control point of the Bezier spline.
Specifies the x-coordinate of the ending point of the Bezier spline.
Specifies the y-coordinate of the ending point of the Bezier spline.
The width, in pixel, of the pen used to draw the arc.
Color of the Bezier spline. 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
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 ImageID As Integer, _
   ByVal Left1 As Single, _
   ByVal Top1 As Single, _
   ByVal Left2 As Single, _
   ByVal Top2 As Single, _
   ByVal Left3 As Single, _
   ByVal Top3 As Single, _
   ByVal Left4 As Single, _
   ByVal Top4 As Single, _
   ByVal PenWidth As Single, _
   ByVal PenColor As Integer, _
   ByVal AntiAlias As Boolean _
) As GdPictureStatus
public GdPictureStatus DrawBezier( 
   int ImageID,
   float Left1,
   float Top1,
   float Left2,
   float Top2,
   float Left3,
   float Top3,
   float Left4,
   float Top4,
   float PenWidth,
   int PenColor,
   bool AntiAlias
)
public function DrawBezier( 
    ImageID: Integer;
    Left1: Single;
    Top1: Single;
    Left2: Single;
    Top2: Single;
    Left3: Single;
    Top3: Single;
    Left4: Single;
    Top4: Single;
    PenWidth: Single;
    PenColor: Integer;
    AntiAlias: Boolean
): GdPictureStatus; 
public function DrawBezier( 
   ImageID : int,
   Left1 : float,
   Top1 : float,
   Left2 : float,
   Top2 : float,
   Left3 : float,
   Top3 : float,
   Left4 : float,
   Top4 : float,
   PenWidth : float,
   PenColor : int,
   AntiAlias : boolean
) : GdPictureStatus;
public: GdPictureStatus DrawBezier( 
   int ImageID,
   float Left1,
   float Top1,
   float Left2,
   float Top2,
   float Left3,
   float Top3,
   float Left4,
   float Top4,
   float PenWidth,
   int PenColor,
   bool AntiAlias
) 
public:
GdPictureStatus DrawBezier( 
   int ImageID,
   float Left1,
   float Top1,
   float Left2,
   float Top2,
   float Left3,
   float Top3,
   float Left4,
   float Top4,
   float PenWidth,
   int PenColor,
   bool AntiAlias
) 

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.
Remarks

This method requires the Image Documents component to run.

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