Jump to content

GpiQueryPatternRefPoint: Difference between revisions

From EDM2
Created page with "This function returns the current pattern reference point, as set by the GpiSetPatternRefPoint function. ==Syntax== <PRE> #define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function returns the current pattern reference point, as set by the GpiSetPatternRefPoint function.
This function returns the current pattern reference point, as set by the [[GpiSetPatternRefPoint]] function.


==Syntax==
==Syntax==
<PRE>
GpiQueryPatternRefPoint(hps, pptlRefPoint)
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
 
HPS        hps;            /* Presentation-space handle. */
PPOINTL    pptlRefPoint;  /* Pattern reference point. */
BOOL      rc;            /* Success indicator. */


rc = GpiQueryPatternRefPoint(hps, pptlRefPoint);
</PRE>
==Parameters==
==Parameters==
; hps (HPS) - input : Presentation-space handle.
;hps (HPS) - input : Presentation-space handle.
 
;pptlRefPoint (PPOINTL) - output : Pattern reference point.
; pptlRefPoint (PPOINTL) - output : Pattern reference point.
If the pattern reference point is currently set to the default, (0,0) is returned.
If the pattern reference point is currently set to the default, (0,0) is returned.


Line 24: Line 15:


==Errors==  
==Errors==  
Possible returns from WinGetLastError
Possible returns from WinGetLastError:
 
: PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
; 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_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously.
: PMERR_INV_IN_RETAIN_MODE (0x208C) : An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
; PMERR_INV_IN_RETAIN_MODE (0x208C) : An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
: PMERR_INV_DC_TYPE (0x2060) : An invalid type parameter was specified with [[DevOpenDC]], or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.
; PMERR_INV_DC_TYPE (0x2060) : An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.


==Remarks==
==Remarks==
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.
This function is invalid when the drawing mode (see [[GpiSetDrawingMode]]) is set to retain.


==Example Code==
==Example Code==
In this example we query the pattern reference point, which is set by the GpiSetPatternRefPoint.
In this example we query the pattern reference point, which is set by the GpiSetPatternRefPoint.
<PRE>
<PRE>
#define INCL_GPIPRIMITIVES
#define INCL_GPIPRIMITIVES
Line 49: Line 38:
xcoord = ptlRefPoint.x; ycoord = ptlRefPoint.y;
xcoord = ptlRefPoint.x; ycoord = ptlRefPoint.y;
</PRE>
</PRE>
==Related Functions==


[[Category:Gpi]]
[[Category:Gpi]]

Latest revision as of 22:24, 7 January 2024

This function returns the current pattern reference point, as set by the GpiSetPatternRefPoint function.

Syntax

GpiQueryPatternRefPoint(hps, pptlRefPoint)

Parameters

hps (HPS) - input
Presentation-space handle.
pptlRefPoint (PPOINTL) - output
Pattern reference point.

If the pattern reference point is currently set to the default, (0,0) is returned.

Return Code

rc (BOOL) - returns
Success indicator.
  • TRUE Successful completion
  • FALSE Error occurred.

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_IN_RETAIN_MODE (0x208C) : An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
PMERR_INV_DC_TYPE (0x2060) : An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.

Remarks

This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.

Example Code

In this example we query the pattern reference point, which is set by the GpiSetPatternRefPoint.

#define INCL_GPIPRIMITIVES
#include <OS2.H>

BOOL flResult;
HPS hps;                /* Presentation space handle. */
POINTL ptlRefPoint;     /* pattern reference point */
LONG xcoord, ycoord;
flResult = GpiQueryPatternRefPoint(hps, &ptlRefPoint );

xcoord = ptlRefPoint.x; ycoord = ptlRefPoint.y;