This method draws a bezier curve in the designated object (the screen, printer, or image data).
* 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 | An array of x and y coordinate values defining points of the polygon |
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 / VB.NET, if Dim x(0 to 2), then the arguments are returned in x. In C#.NET the arguments are returned in ref x. |
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.
This method is recommended when using scripting or other languages that require variant types or when using 64 bit builds in VB.NET or C#.
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
Also see the PolyBezier method.
If the DeviceMode parameter is 0 or2 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:
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
Dim X As Object = CType(CurveX, Object)
Dim Y As Object = CType(CurveY, Object)
Ret = ImageKit1.PrintDraw.PolyBezierVariant(hDC, X, Y, 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;
object X = (object)CurveX;
object Y = (object)CurveY;
Ret = ImageKit1.PrintDraw.PolyBezierVariant(hDC, ref X, ref Y, ImageKit10Lib.OutPutDeviceModeConstants.ikScreen);
Differences between the ImageKit7/8
The DeviceValue argument's type has changed.