Difference between revisions of "GrePolySpline"

From EDM2
Jump to: navigation, search
(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...")
 
m
 
Line 1: Line 1:
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.  
+
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.  
+
This function can be hooked by the presentation driver.
  
;Simulation support: This function is simulated by a handling routine in the graphics engine.  
+
;Simulation support: This function is simulated by a handling routine in the graphics engine.
  
== Syntax ==  
+
== Syntax ==
  GrePolySpline(hdc, paptlPoint, cPoints, pInstance, lFunction);
+
  GrePolySpline(hdc, paptlPoint, cPoints, pInstance, lFunction)
  
 
== Parameters ==
 
== Parameters ==
;hdc (HDC) - input  
+
;hdc (HDC) - input:Device context handle.
: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.
;paptlPoint (PPOINTL) - input  
+
;cPoints (LONG) - input:Number of coordinate pairs in the array. When this is passed as 0, it returns Successful.
:Pointer to coordinates array.  
+
;pInstance (PVOID) - input:Pointer to instance data.
 
+
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGrePolySpline.
: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.  
+
  
 
== Returns ==
 
== Returns ==
;rc (LONG) - returns  
+
;rc (LONG) - returns:Return codes.
:Return codes.  
+
:This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:
 
+
:*GPI_OK Successful
:This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:  
+
:*GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON and a hit is detected)
 
+
:*GPI_ERROR Error
:*GPI_OK Successful  
+
: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:
:*GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON and a hit is detected)  
+
:*PMERR_BASE_ERROR
:*GPI_ERROR Error  
+
:*PMERR_BITMAP_NOT_SELECTED
 
+
:*PMERR_COORDINATE_OVERFLOW
: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:  
+
:*PMERR_DEV_FUNC_NOT_INSTALLED
 
+
:*PMERR_HDC_BUSY
:*PMERR_BASE_ERROR  
+
:*PMERR_INV_COLOR_DATA
:*PMERR_BITMAP_NOT_SELECTED  
+
:*PMERR_INV_COLOR_INDEX
:*PMERR_COORDINATE_OVERFLOW  
+
:*PMERR_INV_COORD_SPACE
:*PMERR_DEV_FUNC_NOT_INSTALLED  
+
:*PMERR_INV_HDC
:*PMERR_HDC_BUSY  
+
:*PMERR_INV_IN_AREA
:*PMERR_INV_COLOR_DATA  
+
:*PMERR_INV_IN_PATH
:*PMERR_INV_COLOR_INDEX  
+
:*PMERR_INV_LENGTH_OR_COUNT
:*PMERR_INV_COORD_SPACE  
+
:*PMERR_INV_PICK_APERTURE_POSN
:*PMERR_INV_HDC  
+
:*PMERR_INV_RECT
:*PMERR_INV_IN_AREA  
+
:*PMERR_PATH_LIMIT_EXCEEDED
:*PMERR_INV_IN_PATH  
+
:*PMERR_PATH_UNKNOWN
:*PMERR_INV_LENGTH_OR_COUNT  
+
:Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
:*PMERR_INV_PICK_APERTURE_POSN  
+
:*PMERR_INV_RECT  
+
:*PMERR_PATH_LIMIT_EXCEEDED  
+
:*PMERR_PATH_UNKNOWN  
+
 
+
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  
+
 
+
  
 
== Sample ==
 
== Sample ==
Line 70: Line 53:
 
LONG      rc;          /*  Return codes. */
 
LONG      rc;          /*  Return codes. */
  
rc = GrePolySpline(hdc, paptlPoint, cPoints,
+
rc = GrePolySpline(hdc, paptlPoint, cPoints, pInstance, lFunction);
      pInstance, lFunction);
+
 
</pre>
 
</pre>
  
 
== Remarks ==
 
== Remarks ==
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.  
+
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.  
+
Refer to the function "GpiPolySpline" in the ''Presentation Manager Programming Reference'' for more information.
  
 
[[Category:Gre]]
 
[[Category:Gre]]

Latest revision as of 21:12, 24 March 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.

Syntax

GrePolySpline(hdc, paptlPoint, cPoints, pInstance, lFunction)

Parameters

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.

Returns

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:
  • PMERR_BASE_ERROR
  • PMERR_BITMAP_NOT_SELECTED
  • PMERR_COORDINATE_OVERFLOW
  • PMERR_DEV_FUNC_NOT_INSTALLED
  • PMERR_HDC_BUSY
  • PMERR_INV_COLOR_DATA
  • PMERR_INV_COLOR_INDEX
  • PMERR_INV_COORD_SPACE
  • PMERR_INV_HDC
  • PMERR_INV_IN_AREA
  • PMERR_INV_IN_PATH
  • PMERR_INV_LENGTH_OR_COUNT
  • PMERR_INV_PICK_APERTURE_POSN
  • PMERR_INV_RECT
  • PMERR_PATH_LIMIT_EXCEEDED
  • PMERR_PATH_UNKNOWN
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample

#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);

Remarks

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.