Export (0) Print
Expand All

CImage::Draw

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

BOOL Draw(
   HDC hDestDC,
   int xDest,
   int yDest,
   int nDestWidth,
   int nDestHeight,
   int xSrc,
   int ySrc,
   int nSrcWidth,
   int nSrcHeight 
) const throw( );
BOOL Draw(
   HDC hDestDC,
   const RECT& rectDest,
   const RECT& rectSrc 
) const throw( );
BOOL Draw(
   HDC hDestDC,
   int xDest,
   int yDest 
) const throw( );
BOOL Draw(
   HDC hDestDC,
   const POINT& pointDest 
) const throw( );
BOOL Draw(
   HDC hDestDC,
   int xDest,
   int yDest,
   int nDestWidth,
   int nDestHeight 
) const throw( );
BOOL Draw(
   HDC hDestDC,
   const RECT& rectDest 
) 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.
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.
rectDest
A reference to a RECT structure, identifying the destination.
rectSrc
A reference to a RECT structure, identifying the source.
pointDest
A reference to a POINT structure that identifies the upper left corner of the destination rectangle, in logical units.

Return Value

Nonzero if successful; otherwise 0.

Remarks

Draw performs the same operation as StretchBlt, unless the image contains a transparent color or alpha channel. In that case, Draw performs the same operation as either TransparentBlt or AlphaBlend as required.

For versions of Draw that do not specify a source rectangle, the entire source image is the default. For the version of Draw that does not specify a size for the destination rectangle, the size of the source image is the default and no stretching or shrinking occurs.

Draw supports transparency only in Windows 2000 or later and Windows 98 or later. See CImage Limitations with Earlier Operating Systems for more detailed information.

See Also

CImage Overview | Class Members

Show:
© 2014 Microsoft