This method draws a bezier curve in the designated object (the screen, printer, or image data).
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
(1)In Visual C++, pass the pointer to the first element of the array (2)In Visual Basic, Dim x(0 To 2) As Long then set x(0) |
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 |
In Visual Basic 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 and other programs that require variant types, please refer to the PolyBezierVariant method.
If the DeviceMode parameter is 0 or 2 then x and y parameters are in pixel units.
If the DeviceMode parameter is 1 then x and y parameters are in 0.1mm units.
Sample code:
Visual Basic
Dim Ret As Boolean
Dim CurveX(4) As Long
Dim CurveY(4) 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);