The BinaryRasterOperation Enumeration section lists the binary raster-operation codes.
Rasteroperation codes define how metafile processing combines the bits from the selected
pen with the bits in the destination bitmap.
Each raster-operation code represents a Boolean operation in which the values of the pixels in the
selected pen and the destination bitmap are combined. Following are the two operands used in these
operations.
Raster-operation code meaning
Operand
Meaning
P
Selected pen
D
Destination bitmap
Following are the Boolean operators used in these operations.
Boolean operator meaning
Operand
Meaning
a
Bitwise AND
n
Bitwise NOT (inverse)
o
Bitwise OR
x
Bitwise exclusive OR (XOR)
All Boolean operations are presented in reverse Polish notation. For example, the following
operation replaces the values of the pixels in the destination bitmap with a combination of the pixel
values of the pen and the selected brush: DPo.
Each raster-operation code is a 32-bit integer whose high-order word is a Boolean operation index and
whose low-order word is the operation code. The 16-bit operation index is a zero-extended, 8-bit
value that represents all possible outcomes resulting from the Boolean operation on two parameters
(in this case, the pen and destination values). For example, the operation indexes for the DPo and
DPan operations are shown in the following list.
Raster-operation examples
P
D
DPo
DPan
0
0
0
1
0
1
1
1
1
0
1
1
1
1
1
0
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
Parameters:
opIndex - the name of the enum constant to be returned.