Jump to content

GpiQueryGraphicsField: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
This function returns the bottom-left and top-right corners of the graphics field in presentation page units, as set by the GpiSetGraphicsField function.
This function returns the bottom-left and top-right corners of the graphics field in presentation page units, as set by the GpiSetGraphicsField
function.


==Syntax==
==Syntax==
<pre>
GpiQueryGraphicsField(hps, prclField)
#define INCL_GPITRANSFORMS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
 
HPS      hps;          /* Presentation-space handle. */
PRECTL  prclField;    /* Graphics field. */
BOOL    rc;          /* Success indicator. */
 
rc = GpiQueryGraphicsField(hps, prclField);
</pre>


==Parameters==
==Parameters==
; hps (HPS) - input : Presentation-space handle.
;hps (HPS) - input : Presentation-space handle.
 
;prclField (PRECTL) - output : Graphics field.
; prclField (PRECTL) - output : Graphics field.


==Return Code==
==Return Code==
 
;rc (BOOL) - returns : Success indicator.
; rc (BOOL) - returns : Success indicator.
* TRUE : Successful completion
 
* FALSE : Error occurred.
; TRUE : Successful completion
 
; FALSE : Error occurred.


===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.
Line 37: Line 21:


==Example Code==
==Example Code==
This example uses GpiQueryGraphicsField to return the bottom-left and top-right corners of the graphics field in presentation page units, as
This example uses GpiQueryGraphicsField to return the bottom-left and top-right corners of the graphics field in presentation page units, as set by the GpiSetGraphicsField call, and then assigns the x coordinate of the lower left hand field corner to a variable.
set by the GpiSetGraphicsField call, and then assigns the x coordinate of the lower left hand field corner to a variable.
 
<pre>
<pre>
#define INCL_GPITRANSFORMS /* Transform functions */
#define INCL_GPITRANSFORMS /* Transform functions */

Revision as of 01:21, 13 June 2019

This function returns the bottom-left and top-right corners of the graphics field in presentation page units, as set by the GpiSetGraphicsField function.

Syntax

GpiQueryGraphicsField(hps, prclField)

Parameters

hps (HPS) - input
Presentation-space handle.
prclField (PRECTL) - output
Graphics field.

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.

Remarks

Example Code

This example uses GpiQueryGraphicsField to return the bottom-left and top-right corners of the graphics field in presentation page units, as set by the GpiSetGraphicsField call, and then assigns the x coordinate of the lower left hand field corner to a variable.

#define INCL_GPITRANSFORMS /* Transform functions */
#include <os2.h>

BOOL fSuccess; /* success indicator */
HPS hps; /* Presentation-space handle */
RECTL prclField; /* graphics field */
LONG lLwrLftxCoord; /* lower left x coordinate of field */

fSuccess = GpiQueryGraphicsField(hps, &prclField);

/* if successful, assign lower left x coordinate of graphics field */
if (fSuccess == TRUE)
   lLwrLftxCoord = prclField.xLeft;

Related Functions