An area primitive is drawn according to the current foreground and background mix attributes and in the current area foreground and area background colors.

When an application draws a monochrome pattern on a color device, the bits of the pattern set to 1 translate to the current area foreground color, and the 0 bits translate to the current area background color. When the application draws a color pattern on a monochrome device, and if the current pattern is anything other than PATSYM_DEFAULT or PATSYM_SOLID from the default pattern set, the color closest to white is translated into 1 bits. For example, if a pattern of diagonal lines is being drawn in which the foreground color is red and the background color is cyan, the cyan is translated to white (1 bits) because cyan is closer than red is to white. Red, therefore is translated to black (0 bits). The effect of translating this color pattern to a monochrome surface is summarized as follows:

Pattern      As 1s and     Color       Monochrome
                0s        Surface       Surface

\   \        10001000     RcccRccc     01110111
 \   \       01000100     cRcccRcc     10111011
  \   \      00100010     ccRcccRc     11011101
   \   \     00010001     cccRcccR     11101110
\   \        10001000     RcccRccc     01110111
 \   \       01000100     cRcccRcc     10111011
  \   \      00100010     ccRcccRc     11011101
   \   \     00010001     cccRcccR     11101110

The original pattern of 1's and 0's is used, however, when deciding which part of the pattern is the background and which part is the foreground. Thus, if the background mix attribute is BM_LEAVEALONE, the following occurs:

Pattern      As 1s and     Color      Monochrome
                0s        Surface      Surface

\   \        10001000     R...R...     0...0...
 \   \       01000100     .R...R..     .0...0..
  \   \      00100010     ..R...R.     ..0...0.
   \   \     00010001     ...R...R     ...0...0
\   \        10001000     R...R...     0...0...
 \   \       01000100     .R...R..     .0...0..
  \   \      00100010     ..R...R.     ..0...0.
   \   \     00010001     ...R...R     ...0...0

The 1 bits on the monochrome surface still are interpreted as the background of the primitive and are not drawn when the BM_LEAVEALONE attribute is specified.

When a bit map is used as an area fill pattern, any bit drawn in the current area background color is set to 0, and all other bits are set to 1 on a monochrome surface. Thus, if the current area background color is blue, all blue bits in the bit map are set to 0, and all other bits are set to 1. The 0 bits constitute the background of the primitive.

If the pattern is solid (PATSYM_DEFAULT or PATSYM_SOLID in the supplied pattern set), the following occurs:

Dithering can be enabled and disabled using LCOL_PURECOLOR in GpiCreateLogColorTable.


[Back] [Next]