Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Pattern Block Transfer
Collapse the table of content
Expand the table of content

Pattern Block Transfer

The name of the PatBlt function (an abbreviation for pattern block transfer) implies that this function simply replicates the brush (or pattern) until it fills a specified rectangle. However, the function is actually much more powerful. Before replicating the brush, it combines the color data for the pattern with the color data for the existing pixels on the video display by using a raster operation (ROP). An ROP is a bitwise operation that is applied to the bits of color data for the replicated brush and the bits of color data for the target rectangle on the display device. There are 256 ROPs; however, the PatBlt function recognizes only those that require a pattern and a destination (not those that require a source). The following table identifies the most common ROPs.

PATCOPYCopies the pattern to the destination bitmap.
PATINVERTCombines the destination bitmap with the pattern by using the Boolean XOR operator.
DSTINVERTInverts the destination bitmap.
BLACKNESSTurns all output to binary zeros.
WHITENESSTurns all output to binary ones.


For more information, see Raster Operation Codes.



Community Additions

© 2015 Microsoft