Jump to content

GpiSetPel

From EDM2
Revision as of 23:28, 2 April 2025 by Iturbide (talk | contribs) (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

#define INCL_GPIBITMAPS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS        hps;        /*  Presentation-space handle. */
PPOINTL    pptlPoint;  /*  Position in world coordinates. */
LONG       lHits;      /*  Correlation and error indicators. */

lHits = GpiSetPel(hps, pptlPoint);

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

  • GpiQueryPel
  • GpiSetAttrs
  • GpiSetBackColor
  • GpiSetBackMix
  • GpiSetColor
  • GpiSetDefAttrs
  • GpiSetMix