CImage::Draw

将源设备上下文的位图到当前设备上下文。

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( );

参数

  • hDestDC
    对目标设备上下文的句柄。

  • xDest
    x坐标,在逻辑单位,目标矩形的左上角。

  • yDest
    y坐标,在逻辑单位,目标矩形的左上角。

  • nDestWidth
    宽度,在逻辑单位,目标矩形。

  • nDestHeight
    高度,在逻辑单位,目标矩形。

  • xSrc
    x坐标,在逻辑单位,源矩形的左上角。

  • ySrc
    y坐标,在逻辑单位,源矩形的左上角。

  • nSrcWidth
    宽度,在逻辑单位,源矩形。

  • nSrcHeight
    高度,在逻辑单位,源矩形。

  • rectDest
    RECT 结构的引用,标识目标。

  • rectSrc
    RECT 结构的引用,标识源。

  • pointDest
    设置为标识目标矩形的左上角的POINT结构的引用,在逻辑单元。

返回值

非零,如果成功;否则为0。

备注

除非图像包含一个透明的颜色或alpha通道,Draw 继续操作并 StretchBlt相同。 在这种情况下,Draw 继续操作并 TransparentBltAlphaBlend 相同根据要求。

对于未指定源矩形 Draw 的版本,整个源图像是默认设置。 对于不为目标矩形参数指定范围 Draw 的版本,源图像的大小是默认值,并拉伸或收缩不会发生。

要求

Header: atlimage.h

请参见

参考

CImage选件类