GpiPolyLineDisjoint
Appearance
This function draws a series of disjoint straight lines using the end-point pairs specified.
Syntax
GpiPolyLineDisjoint(hps, lCount, aptlPoints)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lCount (LONG) - input
- Number of points.
- Must be even and not negative. Zero is valid, but it causes no output. The maximum number of points allowed is system-dependent, but it is at least 7 000.
- aptlPoints (PPOINTL) - input
- Array of points.
Return Value
- lHits (LONG) - returns
- Correlation/error indicator.
- GPI_OK
- Successful
- GPI_HITS
- Correlate hit(s)
- GPI_ERROR
- Error.
Remarks
The effect of this function is the same as the following sequence of calls:
GpiMove (hps, Points[0]); GpiLine (hps, Points[1]); GpiMove (hps, Points[2]); GpiLine (hps, Points[3]); . . . GpiMove (hps, Points[Count-2]); GpiLine (hps, Points[Count-1]);
On completion, current position is set to the last point.
Errors
Possible returns from WinGetLastError:
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
- PMERR_INV_LENGTH_OR_COUNT (0x2092)
- An invalid length or count parameter was specified.
- PMERR_INV_COORDINATE (0x205B)
- An invalid coordinate value was specified.
- PMERR_INV_NESTED_FIGURES (0x20A8)
- Nested figures have been detected within a path definition.
Example Code
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, Also in COMMON section */ #include <os2.h> HPS hps; /* Presentation-space handle. */ LONG lCount; /* Number of points. */ PPOINTL aptlPoints; /* Array of points. */ LONG lHits; /* Correlation/error indicator. */ lHits = GpiPolyLineDisjoint(hps, lCount, aptlPoints);
This example uses the GpiPolyLineDisjoint function to draw two lines.
#define INCL_GPIPRIMITIVES /* GPI primitive functions */ #include <os2.h> HPS hps; /* presentation space handle */ POINTL ptlLines[] = { 100, 100, 100, 200, /* line 1 */ 200, 100, 200, 200 }; /* line 2 */ GpiPolyLineDisjoint(hps, 4L, ptlLines); /* draw lines */