Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>setrop2()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SetROP2()
Set the current drawing mode
------------------------------------------------------------------------------

Syntax
SetROP2( <hDC>, [ <nNewMode> ] )   -->   nOldMode

Arguments
<hDC> specifies the device context.

<nNewMode> is an optional integer specifying the new mode (see
below).

Returns
The returned value is an integer representing the current
drawing mode (one of the values below).

Description
This function changes/queries the current drawing mode, which
determines what GDI does with the existing background
colour(s) when outputting pixels, e.g. when filling the
interior of an object, or using a pen.

(ROP is short for raster operation; you are unlikely to be
drawing on anything that does not support raster ops.)

Most programs will never use the GetROP2() or SetROP2()
functions, but some interesting/useful special effects are
possible.

The mode values, and their effects on the existing pixel(s)
are:

Mode                means

R2_BLACK            draw using black (ignoring the pen colour)

R2_COPYPEN          use the pen colour

R2_MASKNOTPEN       use colour common to inverse of pen colour and
                    existing pixels

R2_MASKPEN          use colour common to pen and existing pixels

R2_MASKPENNOT       use colour common to pen and inverse of existing
                    pixels

R2_MERGENOTPEN      use bitwise OR of inverse of pen colour with
                    existing pixels

R2_MERGEPEN         use bitwise OR of pen with existing pixels

R2_MERGEPENNOT      use bitwise OR of pen with inverse of existing
                    pixels

R2_NOP              no operation (pixels are unchanged)

R2_NOT              inverse of existing pixel colours

R2_NOTCOPYPEN       inverse of pen colour

R2_NOTMASKPEN       inverse of (colour common to pen and existing pixels)

R2_NOTMERGEPEN      inverse of (bitwise OR of pen colour with existing
                    pixels)

R2_NOTXORPEN        inverse of (bitwise XOR of pen with existing pixels)

R2_WHITE            draw using white (ignoring pen colour)

R2_XORPEN           use bitwise XOR of pen with existing pixels

Example
nOldROP = SetROP2( hDC, R2_NOT )
     .
     .    // do some output
     .
SetROP2( hDC, nOldROP )


See Also: GetBkColor() GetBkMode() GetDC() GetROP2()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson