This method draws a bezier curve in the designated object (the screen, printer, or image data).

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.PolyBezier(DeviceValue As LONG_PTR, x As Long, y As Long, Points As Long, DeviceMode As OutPutDeviceModeConstants)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().PolyBezier(LONG_PTR DeviceValue, long *x, long *y, long Points, long DeviceMode)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.PolyBezier(DeviceValue As Integer(x86) or Long(x64), x As Integer, y As Integer, Points As Integer, DeviceMode As ImageKit10(A)Lib.OutPutDeviceModeConstants)
[C#.NET]   [ bool = ]imagekitcontrolname.PrintDraw.PolyBezier(int(x86) or long(x64) DeviceValue, int x, int y, int Points, ImageKit10(A)Lib.OutPutDeviceModeConstants DeviceMode)

* ImageKit10ALib refers to the ANSI version, ImageKit10Lib refers to the Unicode version, (x86) refers to the 32 bit version, and (x64) refers to the 64 bit version.

Parameters

Name Explanation
DeviceValue The device context or the raster image data (i.e. Hdc or ImageHandle) depending on the DeviceMode
x,y The array of x,y coordinates that specifies the polygon
Points The number of points from the x,y arrays (only PolyBezier)
DeviceMode If 0 (ikScreen), then the bezier curve will be drawn in pixel units. If 1 (ikPrinter), the bezier curve will be drawn in 0.1mm units. If 2 (ikMemoryHandle), the bezier curve will be drawn (in pixel units) to the image data according to the DeviceValue parameter
* NOTE for retrieving array values:
In Visual Basic, if the array is defined as Dim x(0 To 2) As Integer, then the arguments are returned in x(0).
In Visual C++, pass the pointer to the first element in the array.
In VB.NET, the arguments are returned in x(0).
In C#.NET, the arguments are returned in x[0].

The following constants can be used: (ikScreen = 0, ikPrinter = 1, ikMemoryHandle = 2).

Return Value

Returns True (nonzero) if successful. Returns False (0) if unsuccessful.

Explanation

The PolyBezier method draws a bezier curve in the designated object. The initial bezier curve consists of 4 points, a start point, 2 control points, and an endpoint. Thereafter the bezier curve consists of 3 points (the control points and endpoint).

To execute this method, the following properties should be set PenWidth, PenStyle, PenMode, PenColor, Transparent, and BackColor. The BackColor property is enabled when the Transparent property is False and the pen is set to draw solid lines.

The value contained in the Points parameter must be (3 X the number of beziers) + a start point

For scripting languages, other programs that require variant types, or when using 64 bit builds in VB.NET or C#, please refer to the PolyBezierVariant method.

If the DeviceMode parameter is 0 (ikScreen) or 2 (ikMemoryHandle) then x and y parameters are in pixel units.

If the DeviceMode parameter is 1 (ikPrinter) then x and y parameters are in 0.1mm units.

 

Sample code:

Visual Basic

    Dim Ret As Boolean

    Dim CurveX(3) As Long

    Dim CurveY(3) As Long

 

    CurveX(0) = 10: CurveY(0) = 100

    CurveX(1) = 50: CurveY(1) = 50

    CurveX(2) = 100: CurveY(2) = 150

    CurveX(3) = 150: CurveY(3) = 100

    ImageKit1.PrintDraw.ClearProperty

    ImageKit1.PrintDraw.PenColor = vbGreen

    ImageKit1.PrintDraw.PenStyle = 1

    ImageKit1.PrintDraw.PenWidth = 15

    Ret = ImageKit1.PrintDraw.PolyBezier(hDC, CurveX(0), CurveY(0), 4, 0)

 

Visual C++

    long CurveX[4], CurveY[4];

 

    CurveX[0] = 10; CurveY[0] = 100;

    CurveX[1] = 50; CurveY[1] = 50;

    CurveX[2] = 100; CurveY[2] = 150;

    CurveX[3] = 150; CurveY[3] = 100;

    ImageKit1.GetPrintDraw().ClearProperty();

    ImageKit1.GetPrintDraw().SetPenColor(RGB(0, 0, 255));

    ImageKit1.GetPrintDraw().SetPenStyle(1);

    ImageKit1.GetPrintDraw().SetPenWidth(15);

    ImageKit1.GetPrintDraw().PolyBezier(hDC, CurveX, CurveY, 4, 0);

 

VB.NET

    Dim Ret As Boolean

    Dim CurveX(3) As Integer

    Dim CurveY(3) As Integer

 

    CurveX(0) = 10: CurveY(0) = 100

    CurveX(1) = 50: CurveY(1) = 50

    CurveX(2) = 100: CurveY(2) = 150

    CurveX(3) = 150: CurveY(3) = 100

    ImageKit1.PrintDraw.ClearProperty()

    ImageKit1.PrintDraw.PenColor = ColorTranslator.ToWin32(Color.Green)

    ImageKit1.PrintDraw.PenStyle = 1

    ImageKit1.PrintDraw.PenWidth = 15

    Ret = ImageKit1.PrintDraw.PolyBezier(hDC, CurveX(0), CurveY(0), 4, 0)

 

C#.NET

    bool Ret;

    int[] CurveX = new int[4];

    int[] CurveY = new int[4];

 

    CurveX[0] = 10; CurveY[0] = 100;

    CurveX[1] = 50; CurveY[1] = 50;

    CurveX[2] = 100; CurveY[2] = 150;

    CurveX[3] = 150; CurveY[3] = 100;

    ImageKit1.PrintDraw.ClearProperty();

    ImageKit1.PrintDraw.PenColor = (uint)ColorTranslator.ToWin32(Color.Green);

    ImageKit1.PrintDraw.PenStyle = ImageKit10Lib.PenStyleConstants.ikPenSolid;

    ImageKit1.PrintDraw.PenWidth = 15;

    Ret = ImageKit1.PrintDraw.PolyBezier(hDC, ref CurveX[0], ref CurveY[0], 4, ImageKit10Lib.OutPutDeviceModeConstants.ikScreen);

 

Differences between the ImageKit7/8

The DeviceValue argument's type has changed.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation