SetROP2

2.x

  int SetROP2(hdc, fnDrawMode)    
  HDC hdc; /* handle of device context */
  int fnDrawMode; /* new drawing mode, */  

The SetROP2 function sets the current drawing mode. The drawing mode specifies how the colors of the pen and the interior of filled objects are combined with the color already on the screen surface.

Parameters

hdc

Identifies the device context.

fnDrawMode

Specifies the new drawing mode. This parameter can be one of the following values:

Value Meaning

R2_BLACK Pixel is always black.
R2_WHITE Pixel is always white.
R2_NOP Pixel remains unchanged.
R2_NOT Pixel is the inverse of the screen 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 screen color (final pixel = (~screen pixel) | pen).
R2_MASKPENNOT Pixel is a combination of the colors common to both the pen and the inverse of the screen (final pixel = (~screen pixel) & pen).
R2_MERGENOTPEN Pixel is a combination of the screen color and the inverse of the pen color (final pixel = (~pen) | screen pixel).
R2_MASKNOTPEN Pixel is a combination of the colors common to both the screen and the inverse of the pen (final pixel = (~pen) & screen pixel).
R2_MERGEPEN Pixel is a combination of the pen color and the screen color (final pixel = pen | screen pixel).
R2_NOTMERGEPEN Pixel is the inverse of the R2_MERGEPEN color (final pixel = ~(pen | screen pixel)).
R2_MASKPEN Pixel is a combination of the colors common to both the pen and the screen (final pixel = pen & screen pixel).
R2_NOTMASKPEN Pixel is the inverse of the R2_MASKPEN color (final pixel = ~(pen & screen pixel)).
R2_XORPEN Pixel is a combination of the colors that are in the pen and in the screen, but not in both (final pixel = pen ^ screen pixel).
R2_NOTXORPEN Pixel is the inverse of the R2_XORPEN color (final pixel = ~(pen ^ screen pixel)).

Return Value

The return value specifies the previous drawing mode, if the function is successful.

Comments

The drawing mode is for raster devices only; it does not apply to vector devices.

Drawing modes are binary raster-operation codes representing all possible Boolean combinations of two variables. These values are created by using the binary operations AND, OR, and XOR (exclusive OR) and the unary operation NOT.

See Also

GetDeviceCaps, GetROP2