Partager via


2.2.2.2.1.1.1.6 Binary Raster Operation (ROP2_OPERATION)

The ROP2_OPERATION structure is used to define how the bits in a destination bitmap and a selected brush or pen are combined by using Boolean operators.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

rop2Operation

rop2Operation (1 byte): An 8-bit, unsigned integer. A raster-operation code that describes a Boolean operation, in Reverse Polish Notation, to perform on the bits in a destination bitmap (D) and selected brush or pen (P). This operation is a combination of the AND (a), OR (o), NOT (n), and XOR (x) Boolean operators.

Value

Meaning

R2_BLACK

0x01

 0

R2_NOTMERGEPEN

0x02

DPon

R2_MASKNOTPEN

0x03

DPna

R2_NOTCOPYPEN

0x04

Pn

R2_MASKPENNOT

0x05

PDna

R2_NOT

0x06

Dn

R2_XORPEN

0x07

DPx

R2_NOTMASKPEN

0x08

DPan

R2_MASKPEN

0x09

DPa

R2_NOTXORPEN

0x0A

DPxn

R2_NOP

0x0B

D

R2_MERGENOTPEN

0x0C

DPno

R2_COPYPEN

0x0D

P

R2_MERGEPENNOT

0x0E

PDno

R2_MERGEPEN

0x0F

PDo

R2_WHITE

0x10

1

For example, by using the previous table, it can be determined that the R2_MERGEPEN (0x0F) operation replaces the values of the pixels in the destination bitmap with a combination of pixel values of the destination and pen.

For more information about binary raster operations, see the material on binary raster operations in [YUAN] section 8.1.