int SetROP2(hdc, fnDrawMode) | |||
HDC hdc; | |||
int fnDrawMode; |
The SetROP2 function sets the current foreground mix mode. GDI uses the foreground mix mode to combine pens and interiors of filled objects with the colors already on the display surface. The foreground mix mode defines how the brush or pen and the existing image are to be combined.
hdc
Identifies the device context.
fnDrawMode
Specifies the new drawing mode. It may be any one of the following values:
Value | Meaning |
R2_BLACK | ||
Pixel is always binary 0. | ||
R2_WHITE | ||
Pixel is always binary 1. | ||
R2_NOP | ||
Pixel remains unchanged. | ||
R2_NOT | ||
Pixel is the inverse of the display color. | ||
R2_COPYPEN | ||
Pixel is the pen color. | ||
R2_NOTCOPYPEN | ||
Pixel is the inverse of the pen color. | ||
R2_MERGEPENNOT | ||
Pixel is a combination of the pen color and the inverse of the display color. | ||
R2_MASKPENNOT | ||
Pixel is a combination of the colors common to both the pen and the inverse of the display. | ||
R2_MERGENOTPEN | ||
Pixel is a combination of the display color and the inverse of the pen color. | ||
R2_MASKNOTPEN | ||
Pixel is a combination of the colors common to both the display and the inverse of the pen. | ||
R2_MERGEPEN | ||
Pixel is a combination of the pen color and the display color. | ||
R2_NOTMERGEPEN | ||
Pixel is the inverse of the R2_MERGEPEN color. | ||
R2_MASKPEN | ||
Pixel is a combination of the colors common to both the pen and the display. | ||
R2_NOTMASKPEN | ||
Pixel is the inverse of the R2_MASKPEN color. | ||
R2_XORPEN | ||
Pixel is a combination of the colors in the pen and in the display, but not in both. | ||
R2_NOTXORPEN | ||
Pixel is the inverse of the R2_XORPEN color. |
The return value specifies the previous drawing mode.
If an error occurred, the return value is zero.
Drawing modes define how GDI combines source and destination colors when drawing with the current pen. The drawing modes are actually binary raster-operation codes, representing all possible Boolean functions of two variables, using the binary operations AND, OR, and XOR (exclusive OR), and the unary operation NOT. The drawing mode is for raster devices only; it is not available on vector devices.
GetDeviceCaps