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

[C++Builder]   [ bool = ]imagekitcontrolname->PrintDraw->PolyBezier(NativeUInt DeviceValue, const TPoint * Points, const int Points_Size, TVIkOutPutDeviceMode DeviceMode)
[C++Builder]   [ bool = ]imagekitcontrolname->PrintDraw->PolyBezier(void * DeviceValue, const TPoint * Points, const int Points_Size, TVIkOutPutDeviceMode DeviceMode)
[Delphi]   [ Boolean = ]imagekitcontrolname.PrintDraw.PolyBezier(DeviceValue: THandle; const Points: array of TPoint; DeviceMode: TVIkOutPutDeviceMode)
[Delphi]   [ Boolean = ]imagekitcontrolname.PrintDraw.PolyBezier(DeviceValue: Pointer; const Points: array of TPoint; DeviceMode: TVIkOutPutDeviceMode)

[TVIkOutPutDeviceMode Type]

Unit
     IkInit

type
     TVIkOutPutDeviceMode = (vikScreen, vikPrinter, vikMemoryHandle);

Parameters

Name Explanation
DeviceValue The device context or the raster image data depending on the DeviceMode
Points An array of x,y coordinates that specifies the polygon.
In C++Builder, the number of points -1 is passed into Points_Size
DeviceMode If vikScreen, then the bezier curve will be drawn in pixel units. If vikPrinter, the bezier curve will be drawn in 0.1mm units. If vikMemoryHandle, the bezier curve will be drawn (in pixel units) to the image memory handle

Return Value

Returns True if successful. Returns False 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

If the DeviceMode parameter is vikScreen or vikMemoryHandle then x and y parameters are in pixel units.

If the DeviceMode parameter is vikPrinter then x and y parameters are in 0.1mm units.

Sample code:

In C++Builder

TPoint Points[4];

Points[0].x = 10; Points[0].y = 100;
Points[1].x = 50; Points[1].y = 50;
Points[2].x = 100; Points[2].y = 150;
Points[3].x = 150; Points[3].y = 100;
VImageKit1->PrintDraw->ClearProperty();
VImageKit1->PrintDraw->PenColor = clGreen;
VImageKit1->PrintDraw->PenStyle = vikPenSolid;
VImageKit1->PrintDraw->PenWidth = 15;
VImageKit1->PrintDraw->PolyBezier(DC, Points, 3, vikScreen);

In Delphi

Points: array[0..3] of TPoint;

Points[0].x := 10; Points[0].y := 100;
Points[1].x := 50; Points[1].y := 50;
Points[2].x := 100; Points[2].y := 150;
Points[3].x := 150; Points[3].y := 100;
VImageKit1.PrintDraw.ClearProperty;
VImageKit1.PrintDraw.PenColor := clGreen;
VImageKit1.PrintDraw.PenStyle := vikPenSolid;
VImageKit1.PrintDraw.PenWidth := 15;
VImageKit1.PrintDraw.PolyBezier(DC, Points, vikScreen);

Differences between the ImageKit7/8/9/10

The x, y parameters have been changed to TPoint type.
In Delphi, it is not necessary to pass the size of the array.
In VCL the constants contain a "v". In ActiveX, the constants are: ikScreen, ikPrinter, ikMemoryHandle.

 

The ImageKit10 VCL is a product created by Newtone Corporation