CDC::PatBlt

Syntax

BOOL PatBlt( int x, int y, int nWidth, int nHeight, DWORD dwRop );

Parameters

x

Specifies the logical x-coordinate of the upper-left corner of the rectangle that is to receive the pattern.

y

Specifies the logical y-coordinate of the upper-left corner of the rectangle that is to receive the pattern.

nWidth

Specifies the width (in logical units) of the rectangle that is to receive the pattern.

nHeight

Specifies the height (in logical units) of the rectangle that is to receive the pattern.

dwRop

Specifies the raster-operation code. Raster-operation codes (ROPs) define how GDI combines colors in output operations that involve a current brush, a possible source bitmap, and a destination bitmap. This parameter may be one of the following values:

Value Meaning

PATCOPY Copies pattern to destination bitmap.
PATINVERT Combines destination bitmap with pattern using the Boolean OR operator.
DSTINVERT Inverts the destination bitmap.
BLACKNESS Turns all output black.
WHITENESS Turns all output white.

Remarks

Creates a bit pattern on the specified device. The pattern is a combination of the selected brush and the pattern already on the device. The raster-operation code specified by dwRop defines how the patterns are to be combined. The values of dwRop for this function are a limited subset of the full 256 ternary raster-operation codes; in particular, an operation code that refers to a source cannot be used. Not all devices support the PatBlt function.

For more information, see the RC_BITBLT capability under the GetDeviceCaps member function.

Return Value

TRUE if the bit pattern is drawn; otherwise FALSE.

See Also

CDC::GetDeviceCaps, ::PatBlt