|
Raster Operations
The last parameter of the BitBlt function (Bit Block Transfer) specifies a raster operation (ROP) that defines exactly how to combine the bits of the source, the destination, and the pattern (as defined by the currently selected brush) to form the destination. Because a bitmap is nothing more than a collection of bit values, the ROP is simply a Boolean equation that operates on the bits. Depending on the device being used, the bits in the bitmap represent different things:
- On binary monochrome devices, each pixel is represented by one bit: 0 for black and 1 for white.
- On grayscale monochrome devices, each pixel is represented by an intensity that is identical for red, green and blue, giving a range from black to gray to white.
- On many color devices, each pixel is represented by a collection of bits, which either form an index into a color table or directly represent a color.
For all device types, the ROP simply acts on the bits present without regard to their actual meaning. The trick is, of course, to combine the bits in a meaningful manner. ROPs provide a variety of ways to combine bitmap data, and you can often achieve the desired effect in more than one way. This article only deals with four of the possibilities. |
|