CURVE

typedefstructtagCurve{L_UINTuStructSize;L_INTnType;L_INTnPointCount;L_POINT*pPoints;L_UINTuFillMode;L_DOUBLEdTension;L_INTnClose;L_INTnReserved;} CURVE, *pCURVE;

TheCURVEstructure defines a curve for theL_SetBitmapRgnCurvefunction and theL_CurveToBezierfunction.

Members

uStructSize

Size of this structure in bytes, for versioning. Use the sizeof() operator to calculate this value.

nType

Flag that indicates the type of curve defined. Possible values are:

Value Meaning
CURVE_BEZIER The points specified in thepPointsfield define a Bezier curve.
CURVE_STANDARD The points specified in thepPointsfield define a standard curve.
CURVE_NATURAL_CUBIC_SPLINE The points specified in thepPointsfield define a natural cubic spline curve.

nPointCount

Number of points in thepPointsarray.

IfnTypeis:

pPoints

Pointer to an array of L_POINT structures that contain the points that define the curve.

uFillMode

Flag that indicates how to handle complex crossing lines. The following are valid values, which are illustrated below:

Value Meaning
L_POLY_WINDING [0] All pixels that are inside the resulting exterior lines are in the region.
L_POLY_ALTERNATE [1] The region includes the area between odd-numbered and even-numbered polygon sides on each scan line.
image\starcurve8.gif

dTension

Value that indicates the "straightness" of the curves that connect points. This value is used only whennTypeCURVE_STANDARD。在0.0之间的有效值d 1.0, where 0.0 indicates straight lines, and 1.0 indicates lines with the highest curvature. A typical value for dTension is 0.5.

image\Tension.gif

nClose

Value that indicates how the curve is closed. This value is used only whennTypeCURVE_STANDARD。可能的值是:

Value Meaning
CURVE_NO_CLOSE [0x0] For n points, draw (n - 3) segments. For example, for points {P0, P1, P2, P3, P4}, draw segments P1P2 and P2P3.
CURVE_CLOSE [0x1] For n points draw (n) segments. For example, for points {P0, P1, P2, P3, P4}, draw segments P0P1, P1P2, P2P3, P3P4, P4P0.
CURVE_PARTIAL_CLOSE (0 x2) n个点绘制(n - 1)段。为考试ple, for points {P0, P1, P2, P3, P4}, draw segments P0P1, P1P2, P2P3, P3P4 (but not P4P0).

In the following diagram, the resulting region is shown in gray.

image\CurveClose.gif

nReserved

Reserved for future use.

Comments

The CURVE structure is used by theL_SetBitmapRgnCurvefunction to draw a curve using an array of POINT items. It is also used by theL_CurveToBezierfunction to convert a curve to a Bezier. The CURVE structure can define three types of curves:

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set theuStructSizemember to the total size, in bytes, of the structure. Use the sizeof() operator to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

LEADTOOLS Raster Imaging C API Help
188金宝搏的网址客服|Support|Contact Us|Intellectual Property Notices
© 1991-2021LEAD Technologies, Inc.All Rights Reserved.