Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CDC::PatBlt

Creates a bit pattern on the device.

BOOL PatBlt( 
   int x, 
   int y, 
   int nWidth, 
   int nHeight, 
   DWORDdwRop  
);
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 can be one of the following values:

  • PATCOPY   Copies pattern to destination bitmap.

  • PATINVERT   Combines destination bitmap with pattern using the Boolean XOR operator.

  • DSTINVERT   Inverts the destination bitmap.

  • BLACKNESS   Turns all output black.

  • WHITENESS   Turns all output white.

Nonzero if the function is successful; otherwise 0.

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 raster operations listed for this function are a limited subset of the full 256 ternary raster-operation codes; in particular, a raster-operation code that refers to a source cannot be used.

Not all device contexts support the PatBlt function. To determine whether a device context supports PatBlt, call the GetDeviceCaps member function with the RASTERCAPS index and check the return value for the RC_BITBLT flag.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.