Jump to content

GpiSetMix: Difference between revisions

From EDM2
Created page with "This function sets the current foreground mix attribute for each individual primitive type. ==Syntax== GpiSetMix(hps, lMixMode); ==Parameters== ;hps (HPS) - input :Presentation-space handle. ;lMixMode (LONG) - input :Flag indicating the color-mixing mode. :Mixing other than FM_LEAVEALONE or FM_OVERPAINT is done on the physical color index. In general, this corresponds to the color index of the logical color table if an indexed color table has been realized. In othe..."
 
 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
:The possible values for this parameter are:
:The possible values for this parameter are:


FM_DEFAULT
:;FM_DEFAULT
        Use default, the same as FM_OVERPAINT, unless changed with GpiSetDefAttrs  
::Use default, the same as FM_OVERPAINT, unless changed with GpiSetDefAttrs  
FM_OR
:;FM_OR
        Logical-OR (*)  
::Logical-OR (*)  
FM_OVERPAINT
:;FM_OVERPAINT
        Overpaint (*)  
::Overpaint (*)  
FM_XOR
:;FM_XOR
        Logical-XOR (*)  
::Logical-XOR (*)  
FM_LEAVEALONE
:;FM_LEAVEALONE
        Leave alone (invisible) (*)  
::Leave alone (invisible) (*)  
FM_AND
:;FM_AND
        Logical-AND  
::Logical-AND  
FM_SUBTRACT
:;FM_SUBTRACT
        (Inverse source) AND destination  
::(Inverse source) AND destination  
FM_MASKSRCNOT
:;FM_MASKSRCNOT
        Source AND (inverse destination)  
::Source AND (inverse destination)  
FM_ZERO
:;FM_ZERO
        All zeros  
::All zeros  
FM_NOTMERGESRC
:;FM_NOTMERGESRC
        Inverse (source OR destination)  
::Inverse (source OR destination)  
FM_NOTXORSRC
:;FM_NOTXORSRC
        Inverse (source XOR destination)  
::Inverse (source XOR destination)  
FM_INVERT
:;FM_INVERT
        Inverse (destination) FM_MERGESRCNOT
::Inverse (destination)  
        Source OR (inverse destination)  
:;FM_MERGESRCNOT
FM_NOTCOPYSRC
::Source OR (inverse destination)  
        Inverse (source) FM_MERGENOTSRC
:;FM_NOTCOPYSRC
        (Inverse source) OR destination  
::Inverse (source)  
FM_NOTMASKSRC
:;FM_MERGENOTSRC
        Inverse (source AND destination)  
::(Inverse source) OR destination  
FM_ONE
:;FM_NOTMASKSRC
        All ones.  
::Inverse (source AND destination)  
 
:;FM_ONE
 
::All ones.


==Returns==
==Returns==
Line 98: Line 98:


==Related Functions==
==Related Functions==
* GpiBeginArea
* [[GpiBeginArea]]
* GpiBox
* GpiBox
* GpiCharString
* GpiCharString
Line 124: Line 124:
* GpiSetBackMix
* GpiSetBackMix
* GpiSetColor
* GpiSetColor
* GpiSetDefAttrs  
* GpiSetDefAttrs


==Graphic Elements and Orders==
==Graphic Elements and Orders==

Latest revision as of 23:48, 2 April 2025

This function sets the current foreground mix attribute for each individual primitive type.

Syntax

GpiSetMix(hps, lMixMode);

Parameters

hps (HPS) - input
Presentation-space handle.
lMixMode (LONG) - input
Flag indicating the color-mixing mode.
Mixing other than FM_LEAVEALONE or FM_OVERPAINT is done on the physical color index. In general, this corresponds to the color index of the logical color table if an indexed color table has been realized. In other circumstances, the color that results from such a mix cannot be predicted. Nevertheless, if FM_XOR is supported for example, drawing the same object twice with a foreground mix of FM_XOR and a background mix of BM_LEAVEALONE with no intervening drawing in other mix modes, causes the object to be erased cleanly.
The currently associated device supports any of the mixes specified as supported in DevQueryCaps (CAPS_FOREGROUND_MIX_SUPPORT). Any other valid mixes may be supported for some primitive types, but otherwise results in FM_OVERPAINT. An error is raised only if the value specified is not one of those listed below.
Note: Mixes marked with an asterisk (*) are mandatory for all devices, except that FM_OR is only mandatory for devices capable of supporting it. FM_XOR is mandatory only on displays.
The possible values for this parameter are:
FM_DEFAULT
Use default, the same as FM_OVERPAINT, unless changed with GpiSetDefAttrs
FM_OR
Logical-OR (*)
FM_OVERPAINT
Overpaint (*)
FM_XOR
Logical-XOR (*)
FM_LEAVEALONE
Leave alone (invisible) (*)
FM_AND
Logical-AND
FM_SUBTRACT
(Inverse source) AND destination
FM_MASKSRCNOT
Source AND (inverse destination)
FM_ZERO
All zeros
FM_NOTMERGESRC
Inverse (source OR destination)
FM_NOTXORSRC
Inverse (source XOR destination)
FM_INVERT
Inverse (destination)
FM_MERGESRCNOT
Source OR (inverse destination)
FM_NOTCOPYSRC
Inverse (source)
FM_MERGENOTSRC
(Inverse source) OR destination
FM_NOTMASKSRC
Inverse (source AND destination)
FM_ONE
All ones.

Returns

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.
PMERR_INV_MIX_ATTR (0x20A3)
An invalid mix attribute value was specified or the default value was explicitly specified with GpiSetAttrs instead of using the defaults mask.

Remarks

The current values for each primitive type are updated. The attribute mode (see GpiSetAttrMode) determines whether the current value of the mix attribute is preserved.

Note: There are restrictions on the use of this function when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.

Example Code

#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS     hps;       /*  Presentation-space handle. */
LONG    lMixMode;  /*  Flag indicating the color-mixing mode. */
BOOL    rc;        /*  Success indicator. */

rc = GpiSetMix(hps, lMixMode);

This function sets the current foreground mix attribute for each individual primitive type.

 
#define INCL_GPIPRIMITIVES
#include <OS2.H>

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

GpiSetMix(hps,
          FM_LEAVEALONE);

Related Functions

  • GpiBeginArea
  • GpiBox
  • GpiCharString
  • GpiCharStringAt
  • GpiCharStringPos
  • GpiCharStringPosAt
  • GpiEndArea
  • GpiFullArc
  • GpiLine
  • GpiMarker
  • GpiMove
  • GpiPartialArc
  • GpiPointArc
  • GpiPolyFillet
  • GpiPolyFilletSharp
  • GpiPolyLine
  • GpiPolyMarker
  • GpiPolySpline
  • GpiQueryCharStringPos
  • GpiQueryCharStringPosAt
  • GpiQueryMix
  • GpiSetAttrMode
  • GpiSetAttrs
  • GpiSetBackColor
  • GpiSetBackMix
  • GpiSetColor
  • GpiSetDefAttrs

Graphic Elements and Orders

Element Type
OCODE_GSMX
This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE.
Order: Set Mix
Element Type
OCODE_GPSMX
This element type is generated if the attribute mode is set to AM_PRESERVE.
Order: Push and Set Mix