[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'InterfaceBase' (#lcl)

# TWidgetSet.SetROP2

Sets the Foreground Mixing Mode in a device context.

## Declaration

Source position: winapih.inc line 255

`public function TWidgetSet.SetROP2(`
`DC: HDC;`
`Mode: Integer`
`):Integer; virtual;`

## Arguments

`DC` |  | The device context.
`Mode` |  | The new mode.

## Function result

The old mode, zero on failure.

## Description

The raster operation specifies how foreground painting (Brush, Pen) is combined with the current pixels in the DC. The operation combines bitwise the distinct red, green and blue values in pixel colors.

There are 16 raster operations using the possible combinations of two (boolean) values:

R2_BLACK
  All black (0).
R2_COPYPEN
  Pen color.
R2_MASKNOTPEN
  Dst and not Pen.
R2_MASKPEN
  Dst and Pen.
R2_MASKPENNOT
  (Not Dst) and Pen.
R2_MERGENOTPEN
  Dst or not Pen.
R2_MERGEPEN
  Dst or Pen.
R2_MERGEPENNOT
  (Not Dst) or Pen.
R2_NOP
  Dst (unchanged).
R2_NOT
  Not Dst.
R2_NOTCOPYPEN
  Not Pen.
R2_NOTMASKPEN
  Not (Dst and Pen).
R2_NOTMERGEPEN
  Not (Dst or Pen).
R2_NOTXORPEN
  Not (Dst xor Pen).
R2_WHITE
  All white.
R2_XORPEN
  Dst xor Pen.

## See also

TWidgetSet.GetROP2 |  | The current Foreground Mixing Mode in a device context.
R2_COPYPEN |  | Binary raster operation (Dst op Pen): Pen.