The mix attribute determines how each primitive an application draws is combined with any existing drawing. In color applications, the mix attribute determines the color that results when one primitive is drawn on top of another. There are two forms of the mix attribute: foreground mix and background mix.

The foreground mix attribute governs how the foreground of a primitive is combined with the existing drawing, and it applies to all primitive types. The background mix attribute governs how the background of a primitive is combined with the existing drawing, and it is applicable only to those primitives that have a background. Primitives that can be affected by the background mix attribute are areas, character strings, images, and markers. The primitive attribute data structures contain fields for both foreground and background color and mix attributes.

There are 17 foreground mix attributes. For each mix attribute, the indexes of the foreground and current drawing-surface colors are combined by using one of the bitwise operators. The available foreground mix settings are listed in the following table.

Foreground Mix Attributes

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Mix Attribute  ³Effect         ³Description                   ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_DEFAULT     ³Default        ³Default foreground mix        ³
³               ³               ³attribute (overpaint).        ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_OR          ³OR             ³Index value of the final color³
³               ³               ³is determined by a bitwise OR ³
³               ³               ³operation on the index of the ³
³               ³               ³foreground color and the index³
³               ³               ³of the color of the drawing   ³
³               ³               ³surface.                      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_OVERPAINT   ³Overpaint      ³Index value of the final color³
³               ³               ³is that of the foreground     ³
³               ³               ³color. This is the default    ³
³               ³               ³foreground mix attribute.     ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_XOR         ³Exclusive-OR   ³Index value of the final color³
³               ³(XOR)          ³is determined by a bitwise XOR³
³               ³               ³operation on the index of the ³
³               ³               ³foreground color and the index³
³               ³               ³of the color of the drawing   ³
³               ³               ³surface.                      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_LEAVEALONE  ³Leave-alone    ³Index value of the final color³
³               ³(Invisible)    ³is that of the index of the   ³
³               ³               ³color of the drawing surface. ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_AND         ³AND            ³Index value of the final color³
³               ³               ³is determined by a bitwise AND³
³               ³               ³operation on the index of the ³
³               ³               ³foreground color and the index³
³               ³               ³of the color of the drawing   ³
³               ³               ³surface.                      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_SUBTRACT    ³(Inverse       ³Index value of the final color³
³               ³Source) AND    ³is determined by inverting the³
³               ³Destination    ³index of the foreground color ³
³               ³               ³and performing a bitwise AND  ³
³               ³               ³operation on this value and   ³
³               ³               ³the index of the color of the ³
³               ³               ³drawing surface.              ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_MASKSRCNOT  ³Source AND     ³Index value of the final color³
³               ³(Inverse       ³is determined by inverting the³
³               ³Destination)   ³index value of the            ³
³               ³               ³drawing-surface color and     ³
³               ³               ³performing a bitwise AND      ³
³               ³               ³operation on this value and   ³
³               ³               ³the index value of the        ³
³               ³               ³foreground color.             ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_ZERO        ³All zeros      ³RGB value of the final color's³
³               ³               ³is always 0x00000000.         ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_NOTMERGESRC ³Inverse (Source³Index value of the final color³
³               ³OR Destination)³is always the inverse of the  ³
³               ³               ³FM_OR result.                 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_NOTXORSRC   ³Inverse (Source³Index value of the final color³
³               ³XOR            ³is always the inverse of the  ³
³               ³Destination)   ³FM_XOR result.                ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_INVERT      ³Inverse        ³Index value of the final color³
³               ³(Destination)  ³is always the inverse of the  ³
³               ³               ³index of the color of the     ³
³               ³               ³drawing surface.              ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_MERGESRCNOT ³Source OR      ³Index value of the final color³
³               ³(Inverse       ³is determined by performing a ³
³               ³Destination)   ³bitwise OR operation on the   ³
³               ³               ³index of the foreground color ³
³               ³               ³and the inverse of the index  ³
³               ³               ³of the color of the drawing   ³
³               ³               ³surface.                      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_NOTCOPYSRC  ³Inverse        ³Index value of the final color³
³               ³(Source)       ³is the inverse of the index of³
³               ³               ³the foreground color.         ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_MERGENOTSRC ³(Inverse       ³Index value of the final color³
³               ³Source) OR     ³is determined by performing a ³
³               ³Destination    ³bitwise AND operation on the  ³
³               ³               ³index of the drawing surface's³
³               ³               ³color and the inverse of the  ³
³               ³               ³index of the foreground color.³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_NOTMASKSRC  ³Inverse (Source³Index value of the final color³
³               ³AND            ³is the inverse of the FM_AND  ³
³               ³Destination)   ³result.                       ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³FM_ONE         ³All 1's.       ³RGB value of the final color  ³
³               ³               ³is always 0x00FFFFFF.         ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

There are five background mix attributes. For each mix attribute, the index value for the background color and the current drawing-surface color (in the device's physical color table) are combined using one of the bitwise operators.

The RGB values are those from the physical color table. When the result of the mix attribute's bitwise operation defines a color different from that of both the drawing surface and the drawing attribute, the resulting index accesses an RGB color in the physical table. The color, therefore, is unpredictable unless the logical color table has been realized (using the palette manager).

The first five of the foreground mix attributes also are available as background mix attributes. The background mix attributes are listed in the following table.

Background Mix Attributes

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Mix Attribute  ³Effect         ³Description                   ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³BM_DEFAULT     ³Default        ³Default background mix        ³
³               ³               ³attribute (Leave-alone).      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³BM_OR          ³OR             ³Index value of the final color³
³               ³               ³is determined by a bitwise OR ³
³               ³               ³operation on the index of the ³
³               ³               ³background color and the index³
³               ³               ³of the color of the drawing   ³
³               ³               ³surface.                      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³BM_OVERPAINT   ³Overpaint      ³Index value of the final color³
³               ³               ³is that of the background     ³
³               ³               ³color.                        ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³BM_XOR         ³Exclusive-OR   ³Index value of the final color³
³               ³(XOR)          ³is determined by a bitwise XOR³
³               ³               ³operation on the index of the ³
³               ³               ³background color and the index³
³               ³               ³of the color of the drawing   ³
³               ³               ³surface.                      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³BM_LEAVEALONE  ³Leave-alone    ³Index value of the final color³
³               ³(Invisible)    ³is that of the drawing-surface³
³               ³               ³color.                        ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

The most frequently used foreground mix attributes are FM_OVERPAINT, which is the default value, FM_OR, and FM_XOR. The most frequently used background mix attributes are BM_LEAVEALONE, which is the default value, and BM_OVERPAINT.


[Back] [Next]