GpiQueryMix
Appearance
This function returns the current value of the (character) foreground color-mixing mode, as set by the GpiSetMix function.
Syntax
GpiQueryMix(hps)
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Value
- lMixMode (LONG) - returns
- Mix mode.
- FM_DEFAULT (0L) - Default
- FM_OR (1L) - Logical-OR
- FM_OVERPAINT (2L) - Overpaint
- FM_XOR (4L) - Logical-XOR
- FM_LEAVEALONE (5L) - Leave alone (invisible)
- FM_AND (6L) - Logical-AND
- FM_SUBTRACT (7L) - (Inverse source) AND destination
- FM_MASKSRCNOT (8L) - Source AND (inverse destination)
- FM_ZERO (9L) - All zeros
- FM_NOTMERGESRC (10L) - Inverse (source OR destination)
- FM_NOTXORSRC (11L) - Inverse (source XOR destination)
- FM_INVERT (12L) - Inverse (destination)
- FM_MERGESRCNOT (13L) - Source OR (inverse destination)
- FM_NOTCOPYSRC (14L) - Inverse (source)
- FM_MERGENOTSRC (15L) - (inverse source) OR destination
- FM_NOTMASKSRC (16L) - Inverse (source AND destination)
- FM_ONE (17L) - All ones
- FM_ERROR (-1L) - Error.
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 GpiQueryMix to return the current foreground-mixing mode after setting the draw mode to DRAW.
#define INCL_GPIPRIMITIVES /* Primitive functions */ #define INCL_GPICONTROL /* Control functions */ #include <os2.h> HPS hps; /* Presentation-space handle */ LONG lMixMode; /* mix mode */ if (GpiSetDrawingMode(hps, DM_DRAW) == TRUE) lMixMode = GpiQueryMix(hps);