PlgBlt

  BOOL PlgBlt(hdcDest, lpPoint, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, hbmMask, xMask, yMask)    
  HDC hdcDest; /* handle of destination device-context */
  LPPOINT lpPoint; /* vertices of destination parallelogram */
  HDC hdcSrc; /* handle of source device-context */
  int nXSrc; /* upper-left corner of source rectangle */
  int nYSrc; /* upper-left corner of source rectangle */
  int nWidth; /* width of source rectangle */
  int nHeight; /* height of source rectangle */
  HBITMAP hbmMask; /* handle of bitmask */
  int xMask; /* upper-left corner of bitmask rectangle */
  int yMask; /* upper-left corner of bitmask rectangle */

The PlgBlt function performs a bit-block transfer, copying bits of color data from the specified rectangle in the source device-context to the specified parallelogram in the destination device-context. If the given bitmask handle identifies a valid monochrome bitmap, the function uses this bitmap to mask the bits of color data from the source rectangle.

Parameters

hdcDest

Identifies the destination device-context.

lpPoint

An array of 3 points in logical space which identify three corners of the destination parallelogram. The upper-left corner of the source rectangle is mapped to the first point in this array. The upper-right corner of the source rectangle is mapped to the second point in this array. And, the lower-left corner of the source rectangle is mapped to the third point in this array. The lower-right corner of the source rectangle is mapped to the implicit fourth point in the parallelogram.

hdcSrc

Identifies the source device-context.

nXSrc

Specifies the logical x-coordinate of the upper-left corner of the source rectangle.

nYSrc

Specifies the logical y-coordinate of the upper-left corner of the source rectangle.

nWidth

Specifies the logical width of the source rectangle.

nHeight

Specifies the logical height of the source rectangle.

hbmMask

Identifies an optional monochrome bitmap which is used to mask the colors of the source rectangle.

xMask

Specifies the x-coordinate of the upper-left corner of the the monochrome bitmap.

yMask

Specifies the y-coordinate of the upper-left corner of the the monochrome bitmap.

Return Value

The return value is TRUE if the function was successful. Otherwise it is FALSE.

Comments

The fourth vertex of the parallelogram (D) is defined by treating the first three points (A, B, and C) like vectors and computing D = B + CA.

If the bitmask exists, a value of 1 (in the mask) indicates that the destination pixel color should be combined with the source pixel color using the high-order word of dwROP. A value of 0 (in the mask) indicates that the destination pixel color should be combined with the source pixel color using the low-order word of dwROP.

If the mask rectangle is smaller than the source and destination rectangle, the function will replicate the mask pattern.

Scaling, translation, or reflection transformations are allowed in the source device-context; however, rotation and shear transformations are not.

If the mask bitmap is not a monochrome bitmap, an error will occur.

The stretching mode for the destination device-context is used to determine how to stretch or compress the pixels if needed.

When recording an enhanced metafile, it is an error if the source device context identifies the enhanced metafile device context.

The destination coordinates are transformed according to the destination device context; the source coordinates are transformed according to the source device context. An error will be returned if the source transform has a rotation or shear.

If the destination or source do not have the same color format PlgBlt converts the source to match the destination.

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

PlgBlt returns an error if the source and destination device contexts represent incompatible devices.

See Also

GetDeviceCaps, MaskBlt, StretchBlt, SetStretchBltMode