SetROP2 (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This 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 screen. The foreground mix mode defines how colors from the brush or pen are combined with the colors in the existing image.

int SetROP2( 
  HDC hdc, 
  int fnDrawMode
);

Parameters

hdc
[in] Handle to the device context.
fnDrawMode
[in] Specifies the new mix mode. It is one of the following values.
ValueDescription
R2_BLACKPixel is always 0.
R2_COPYPENPixel is the pen color.
R2_MASKNOTPENPixel is a combination of the colors common to both the screen and the inverse of the pen.
R2_MASKPENPixel is a combination of the colors common to both the pen and the screen.
R2_MASKPENNOTPixel is a combination of the colors common to both the pen and the inverse of the screen.
R2_MERGENOTPENPixel is a combination of the screen color and the inverse of the pen color.
R2_MERGEPENPixel is a combination of the pen color and the screen color.
R2_MERGEPENNOTPixel is a combination of the pen color and the inverse of the screen color.
R2_NOPPixel remains unchanged.
R2_NOTPixel is the inverse of the screen color.
R2_NOTCOPYPENPixel is the inverse of the pen color.
R2_NOTMASKPENPixel is the inverse of the R2_MASKPEN color.
R2_NOTMERGEPENPixel is the inverse of the R2_MERGEPEN color.
R2_NOTXORPENPixel is the inverse of the R2_XORPEN color.
R2_WHITEPixel is always 1.
R2_XORPENPixel is a combination of the colors in the pen and in the screen, but not in both.

Return Values

If the function succeeds, the return value is the previous mix mode.

If the function fails, the return value is zero.

To get extended error information, call GetLastError.

Remarks

Mix modes define how GDI combines source and destination colors when drawing with the current pen.

The mix modes are 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 mix mode is for raster devices only; it is not available for vector devices.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Windows.h.
Link Library: Coredll.lib.

See Also

CreatePatternBrush | GDI Functions


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show: