Jump to content

GpiQueryGraphicsField

From EDM2
Revision as of 23:57, 20 January 2017 by Martini (talk | contribs)

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.

Syntax

#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);

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