Logo
iball
 Home
 About
 Products
 Applications
 Employment
 Contact
 Links

Comparing Images with Overlays
(continued)

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.

Predefined name

Boolean operation

Use in transparency overlays

SRCCOPY

src

Copies the source directly to the destination

SRCAND

src AND dest

Blacks out sections of the destination that correspond to the black areas in the source and leaves sections that line up with white areas in the source untouched.

SRCINVERT

src XOR dest

Inverts the source onto the destination. When used twice, restores destination to its original state. Can also be used instead of SRCPAINT under certain conditions.

SRCPAINT

src OR dest

Paints the nonblack sections of the source onto the destination. Black sections of the source do not alter the destination. Black sections of the destination are painted by the source.

Page 1 2 3 4 5 6

Site designed by:

NAMCAniSmLogo
[Home] [About] [Products] [Applications] [Employment] [Contact] [Links]

Copyright © 1999 ORS Automation, Inc. All rights reserved.
Information in this document is subject to change without notice.
Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.