Difference between revisions of "GrePolySpline"
(Created page with "GrePolySpline draws a sequence of one or more Bezier splines starting at the current (X,Y) position. As each spline is drawn, the specified end point for the spline becomes th...")
Latest revision as of 03:12, 16 January 2020
GrePolySpline draws a sequence of one or more Bezier splines starting at the current (X,Y) position. As each spline is drawn, the specified end point for the spline becomes the start point for the next spline. Upon completion, the current (X,Y) position is the end point of the last spline.
This function can be hooked by the presentation driver.
- Simulation support
- This function is simulated by a handling routine in the graphics engine.
GrePolySpline(hdc, paptlPoint, cPoints, pInstance, lFunction);
- hdc (HDC) - input
- Device context handle.
- paptlPoint (PPOINTL) - input
- Pointer to coordinates array.
- An array of elements in which each group contains three pairs of (X,Y) coordinates for the control and end points for the splines. If COM_TRANSFORM is not set, the function expects the points to be in screen coordinates.
- cPoints (LONG) - input
- Number of coordinate pairs in the array. When this is passed as 0, it returns Successful.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGrePolySpline.
- rc (LONG) - returns
- Return codes.
- This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:
- GPI_OK Successful
- GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON and a hit is detected)
- GPI_ERROR Error
- Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
#define INCL_GRE_ARCS #include <os2.h> HDC hdc; /* Device context handle. */ PPOINTL paptlPoint; /* Pointer to coordinates array. */ LONG cPoints; PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; LONG rc; /* Return codes. */ rc = GrePolySpline(hdc, paptlPoint, cPoints, pInstance, lFunction);
The shape of each spline is controlled by a set of coordinates for three connected lines. The spline starts at the current position and ends at the end point of the third line. The end points of the first and second lines are used as control points. An individual spline always lies within the area bounded by the start, end, and control points.
Refer to the function "GpiPolySpline" in the Presentation Manager Programming Reference for more information.