This documentation is archived and is not being maintained.

CImage::TransparentBlt

Copies a bitmap from the source device context to this current device context.

BOOL TransparentBlt(
   HDC hDestDC,
   int xDest,
   int yDest,
   int nDestWidth,
   int nDestHeight,
   UINT crTransparent = CLR_INVALID 
) const throw( );
BOOL TransparentBlt(
   HDC hDestDC,
   const RECT& rectDest,
   UINT crTransparent = CLR_INVALID 
) const throw( );
BOOL TransparentBlt(
   HDC hDestDC,
   int xDest,
   int yDest,
   int nDestWidth,
   int nDestHeight,
   int xSrc,
   int ySrc,
   int nSrcWidth,
   int nSrcHeight,
   UINT crTransparent = CLR_INVALID 
) const throw( );
BOOL TransparentBlt(
   HDC hDestDC,
   const RECT& rectDest,
   const RECT& rectSrc,
   UINT crTransparent = CLR_INVALID 
) const throw( );

Parameters

hDestDC
A handle to the destination device context.
xDest
The x-coordinate, in logical units, of the upper left corner of the destination rectangle.
yDest
The y-coordinate, in logical units, of the upper left corner of the destination rectangle.
nDestWidth
The width, in logical units, of the destination rectangle.
nDestHeight
The height, in logical units, of the destination rectangle.
crTransparent
The color in the source bitmap to treat as transparent. By default, CLR_INVALID, indicating that the color currently set as the transparent color of the image should be used.
rectDest
A reference to a RECT structure, identifying the destination.
xSrc
The x-coordinate, in logical units, of the upper left corner of the source rectangle.
ySrc
The y-coordinate, in logical units, of the upper left corner of the source rectangle.
nSrcWidth
The width, in logical units, of the source rectangle.
nSrcHeight
The height, in logical units, of the source rectangle.
rectSrc
A reference to a RECT structure, identifying the source.

Return Value

TRUE if successful, otherwise FALSE.

Remarks

TransparentBlt is supported for source bitmaps of 4 bits per pixel and 8 bits per pixel. Use CImage::AlphaBlend to specify 32 bits-per-pixel bitmaps with transparency.

This method is applicable to Microsoft Windows 2000, Windows 98, and later systems. See TransparentBlt in the Platform SDK and CImage Limitations with Earlier Operating Systems for more detailed information.

See Also

CImage Overview | Class Members | CImage::StretchBlt | CImage::MaskBlt | CImage::BitBlt

Show: