GpiQueryCharShear: Difference between revisions
Appearance
Created page with "This function returns the value of the current character-shear angle, as set by the GpiSetCharShear function. ==Syntax== GpiQueryCharShear(hps, pptlShear) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ; pptlShear (PPOINTL) - output : Character shear. : A point, relative to (0,0), that defines the character shear vector. : If the character shear is currently set to the default, (0,1) is returned. ==Return Value== ; rc (BOOL) - return..." |
mNo edit summary |
||
| Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
; hps ([[HPS]]) - input | ; hps ([[HPS]]) - input: Presentation-space handle. | ||
: Presentation-space handle. | ; pptlShear ([[PPOINTL]]) - output: Character shear. | ||
; pptlShear ([[PPOINTL]]) - output | |||
: Character shear. | |||
: A point, relative to (0,0), that defines the character shear vector. | : A point, relative to (0,0), that defines the character shear vector. | ||
: If the character shear is currently set to the default, (0,1) is returned. | : If the character shear is currently set to the default, (0,1) is returned. | ||
==Return Value== | ==Return Value== | ||
; rc ([[BOOL]]) - returns | ; rc ([[BOOL]]) - returns: Success indicator. | ||
: Success indicator. | :: TRUE - Successful completion | ||
: | :: FALSE - Error occurred. | ||
: | |||
==Remarks== | ==Remarks== | ||
| Line 26: | Line 20: | ||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError: | Possible returns from WinGetLastError: | ||
; PMERR_INV_HPS (0x207F) | ; PMERR_INV_HPS (0x207F): An invalid presentation-space handle was specified. | ||
: 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) | ; 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. | ||
: An attempt was made to access the presentation space from more than one thread simultaneously. | ; 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_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. | |||
==Example Code== | ==Example Code== | ||
This example uses GpiQueryCharShear to return the value of the current character-shear angle, as set by the GpiSetCharShear call; if successful, it assigns the x-coordinate of the returned vector to a variable. | This example uses GpiQueryCharShear to return the value of the current character-shear angle, as set by the GpiSetCharShear call; if successful, it assigns the x-coordinate of the returned vector to a variable. | ||
<pre> | <pre> | ||
#define INCL_GPIPRIMITIVES /* Primitive functions */ | #define INCL_GPIPRIMITIVES /* Primitive functions */ | ||
#include | #include <os2.h> | ||
BOOL fSuccess; /* success indicator */ | BOOL fSuccess; /* success indicator */ | ||
Latest revision as of 01:29, 17 November 2025
This function returns the value of the current character-shear angle, as set by the GpiSetCharShear function.
Syntax
GpiQueryCharShear(hps, pptlShear)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- pptlShear (PPOINTL) - output
- Character shear.
- A point, relative to (0,0), that defines the character shear vector.
- If the character shear is currently set to the default, (0,1) is returned.
Return Value
- rc (BOOL) - returns
- Success indicator.
- TRUE - Successful completion
- FALSE - Error occurred.
Remarks
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.
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.
Example Code
This example uses GpiQueryCharShear to return the value of the current character-shear angle, as set by the GpiSetCharShear call; if successful, it assigns the x-coordinate of the returned vector to a variable.
#define INCL_GPIPRIMITIVES /* Primitive functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HPS hps; /* Presentation-space handle */ POINTL pptlShear; /* character shear */ LONG lxCoord; /* shear angle vector x coordinate */ fSuccess = GpiQueryCharShear(hps, &pptlShear); if (fSuccess == TRUE) lxCoord = pptlShear.x;