GpiQueryPattern: Difference between revisions
Appearance
Created page with "This function returns the current value of the shading-pattern symbol, as set by the GpiSetPattern function. ==Syntax== <PRE> #define INCL_GPIPRIMITIVES /* Or use INCL_GPI, I..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
This function returns the current value of the shading-pattern symbol, as set by the GpiSetPattern function. | This function returns the current value of the shading-pattern symbol, as set by the [[GpiSetPattern]] function. | ||
==Syntax== | ==Syntax== | ||
GpiQueryPattern(hps) | |||
==Parameters== | ==Parameters== | ||
; hps (HPS) - input : Presentation-space handle. | ;hps (HPS) - input : Presentation-space handle. | ||
==Return Code== | ==Return Code== | ||
; lPatternSymbol (LONG) - returns : Pattern symbol. | ; lPatternSymbol (LONG) - returns : Pattern symbol. | ||
* PATSYM_DEFAULT Default | * PATSYM_DEFAULT Default | ||
* PATSYM_DENSE1 to PATSYM_DENSE8 (1L to 8L) Solid shading with decreasing density | * PATSYM_DENSE1 to PATSYM_DENSE8 (1L to 8L) Solid shading with decreasing density | ||
Line 27: | Line 19: | ||
* PATSYM_BLANK (18L) Blank | * PATSYM_BLANK (18L) Blank | ||
* PATSYM_ERROR (-1L) Error. | * PATSYM_ERROR (-1L) Error. | ||
; PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously. | ==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== | ==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== | ||
Line 44: | Line 33: | ||
<PRE> | <PRE> | ||
#define INCL_GPIPRIMITIVES | #define INCL_GPIPRIMITIVES | ||
#include < | #include <os2.h> | ||
LONG lResult; /* pattern symbol if > 0 */ | LONG lResult; /* pattern symbol if > 0 */ | ||
Line 55: | Line 44: | ||
} | } | ||
</PRE> | </PRE> | ||
[[Category:Gpi]] | [[Category:Gpi]] |
Latest revision as of 12:39, 1 November 2023
This function returns the current value of the shading-pattern symbol, as set by the GpiSetPattern function.
Syntax
GpiQueryPattern(hps)
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Code
- lPatternSymbol (LONG) - returns
- Pattern symbol.
- PATSYM_DEFAULT Default
- PATSYM_DENSE1 to PATSYM_DENSE8 (1L to 8L) Solid shading with decreasing density
- PATSYM_VERT (9L) Vertical pattern
- PATSYM_HORIZ (10L) Horizontal pattern
- PATSYM_DIAG1 to PATSYM_DIAG1 (11L to 14L) Diagonal pattern 1 to 4, bottom left to top right
- PATSYM_NOSHADE (15L) No shading
- PATSYM_SOLID (16L) Solid shading
- PATSYM_HALFTONE (17L) Alternate pels set on
- PATSYM_BLANK (18L) Blank
- PATSYM_ERROR (-1L) 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_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 current value of the shading-pattern symbol, as set by the GpiSetPattern call.
#define INCL_GPIPRIMITIVES #include <os2.h> LONG lResult; /* pattern symbol if > 0 */ HPS hps; /* Presentation space handle. */ if(PATSYM_SOLID == GpiQueryPattern(hps)) { /* . */ /* . */ }