Jump to content

GpiQueryMix: Difference between revisions

From EDM2
Created page with "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) :: Lo..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
; hps ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.


==Return Value==
==Return Value==
; lMixMode ([[LONG]]) - returns
; lMixMode ([[LONG]]) - returns: Mix mode.
: Mix mode.
:: FM_DEFAULT (0L) - Default
:; FM_DEFAULT (0L)
:: FM_OR (1L) - Logical-OR
:: Default
:: FM_OVERPAINT (2L) - Overpaint
:; FM_OR (1L)
:: FM_XOR (4L) - Logical-XOR
:: Logical-OR
:: FM_LEAVEALONE (5L) - Leave alone (invisible)
:; FM_OVERPAINT (2L)
:: FM_AND (6L) - Logical-AND
:: Overpaint
:: FM_SUBTRACT (7L) - (Inverse source) AND destination
:; FM_XOR (4L)
:: FM_MASKSRCNOT (8L) - Source AND (inverse destination)
:: Logical-XOR
:: FM_ZERO (9L) - All zeros
:; FM_LEAVEALONE (5L)
:: FM_NOTMERGESRC (10L) - Inverse (source OR destination)
:: Leave alone (invisible)
:: FM_NOTXORSRC (11L) - Inverse (source XOR destination)
:; FM_AND (6L)
:: FM_INVERT (12L) - Inverse (destination)
:: Logical-AND
:: FM_MERGESRCNOT (13L) - Source OR (inverse destination)
:; FM_SUBTRACT (7L)
:: FM_NOTCOPYSRC (14L) - Inverse (source)
:: (Inverse source) AND destination
:: FM_MERGENOTSRC (15L) - (inverse source) OR destination
:; FM_MASKSRCNOT (8L)
:: FM_NOTMASKSRC (16L) - Inverse (source AND destination)
:: Source AND (inverse destination)
:: FM_ONE (17L) - All ones
:; FM_ZERO (9L)
:: FM_ERROR (-1L) - Error.
:: 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==
==Remarks==
Line 53: Line 33:
==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==
<PRE>
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS  hps;      /* Presentation-space handle. */
LONG lMixMode; /* Mix mode. */
lMixMode = GpiQueryMix(hps);
</PRE>
This example uses GpiQueryMix to return the current foreground-mixing mode after setting the draw mode to DRAW.
This example uses GpiQueryMix to return the current foreground-mixing mode after setting the draw mode to DRAW.
<pre>
<pre>
#define INCL_GPIPRIMITIVES /* Primitive functions */
#define INCL_GPIPRIMITIVES /* Primitive functions */
#define INCL_GPICONTROL /* Control functions */
#define INCL_GPICONTROL /* Control functions */
#include &lt;os2.h&gt;
#include <os2.h>


HPS hps; /* Presentation-space handle */
HPS hps; /* Presentation-space handle */

Latest revision as of 01:32, 17 November 2025

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