Jump to content

GpiSetPel: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
 
Line 29: Line 29:
==Example Code==
==Example Code==
This function sets a pel, at a position specified in world coordinates, using the current (line) color and mix.
This function sets a pel, at a position specified in world coordinates, using the current (line) color and mix.
<pre>  
<pre>
#define INCL_GPIBITMAPS
#define INCL_GPIBITMAPS
#include <OS2.H>
#include <OS2.H>

Latest revision as of 11:26, 3 April 2025

This function sets a pel, at a position specified in world coordinates, using the current (line) color and mix.

Syntax

GpiSetPel(hps, pptlPoint)

Parameters

hps (HPS) - input
Presentation-space handle.
pptlPoint (PPOINTL) - input
Position in world coordinates.

Returns

lHits (LONG) - returns
Correlation and error indicators.
GPI_OK - Successful
GPI_HITS - Correlate hits
GPI_ERROR - Error.

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_COORDINATE (0x205B)
An invalid coordinate value was specified.

Remarks

This function is subject to all the usual clipping (clip path, clip region, viewing limits, graphics field, visible region), and no error is returned if the point is subject to clipping.

This function is independent of drawing mode (see GpiSetDrawingMode); the effect always occurs immediately, and it is not retained even if the drawing mode is draw-and-retain or retain. (Its effect is, however, recorded in a metafile, but note that this is only successful if the metafile is replayed on a similar device, with draw drawing mode.)

Note: This function must not be used when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.

Example Code

This function sets a pel, at a position specified in world coordinates, using the current (line) color and mix.

#define INCL_GPIBITMAPS
#include <OS2.H>
HPS hps;         /* Presentation-space handle. */

POINTL ptlPoint = {0,0};

GpiSetPel(hps, &ptlPoint);

Related Functions