TransparentImage

The TransparentImage function transfers a bitmap, omitting the portions drawn in a specified color.

Syntax

BOOL TransparentImage(HDC hdcDest, LONG DstX, LONG DstY, LONG DstCx, LONG DstCy, HANDLE hSrc, LONG SrcX, LONG SrcY, LONG SrcCx, LONG SrcCy, COLORREF TransparentColor );

At a Glance

Header file: Wingdi.h
Component: mgblt2
Platforms: H/PC
Windows CE versions: 2.0 and later

Parameters

hdcDest
Handle to a device context.
DstX
Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
DstY
Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
DstCx
Specifies the width, in logical units, of the destination rectangle.
DistCy
Specifies the height, in logical units, of the destination rectangle.
hSrc
Specifies a source device context or a source bitmap.
SrcX
Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle.
SrcY
Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle.
SrcCx
Specifies the width, in logical units, of the source rectangle.
SrcCy
Specifies the height, in logical units, of the source rectangle.
TransparentColor
Indicates the color in the bitmap that will be rendered transparent.

Return Values

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

If the hSrc parameter is a HBITMAP, then that bitmap must not be selected into a device context at the time TransparentImage is called.

See Also

StretchBlt, MaskBlt