Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PatBlt function

The PatBlt function paints the specified rectangle using the brush that is currently selected into the specified device context. The brush color and the surface color or colors are combined by using the specified raster operation.

Syntax


BOOL PatBlt(
  _In_ HDC   hdc,
  _In_ int   nXLeft,
  _In_ int   nYLeft,
  _In_ int   nWidth,
  _In_ int   nHeight,
  _In_ DWORD dwRop
);

Parameters

hdc [in]

A handle to the device context.

nXLeft [in]

The x-coordinate, in logical units, of the upper-left corner of the rectangle to be filled.

nYLeft [in]

The y-coordinate, in logical units, of the upper-left corner of the rectangle to be filled.

nWidth [in]

The width, in logical units, of the rectangle.

nHeight [in]

The height, in logical units, of the rectangle.

dwRop [in]

The raster operation code. This code can be one of the following values.

ValueMeaning
PATCOPY

Copies the specified pattern into the destination bitmap.

PATINVERT

Combines the colors of the specified pattern with the colors of the destination rectangle by using the Boolean XOR operator.

DSTINVERT

Inverts the destination rectangle.

BLACKNESS

Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)

WHITENESS

Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)

 

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

The values of the dwRop parameter 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 rectangle cannot be used.

Not all devices support the PatBlt function. For more information, see the description of the RC_BITBLT capability in the GetDeviceCaps function.

Examples

For an example, see "Example of Menu-Item Bitmaps" in Using Menus.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Brushes Overview
Brush Functions
GetDeviceCaps

 

 

Community Additions

ADD
Show:
© 2015 Microsoft