使用GDI+绘制缩放图片使用Image::DrawImage函数 Status DrawImage(IN Image* image, IN const Point* destPoints, IN INT count, IN INT srcx, IN INT srcy, IN INT srcwidth, IN INT srcheight, IN Unit srcUnit, IN const ImageAttributes* imageAttributes = NULL, IN DrawImageAbort callback = NULL, IN VOID* callbackData = NULL)
Status DrawImage(IN Image* image,
IN const Point* destPoints,
IN INT count,
IN INT srcx,
IN INT srcy,
IN INT srcwidth,
IN INT srcheight,
IN Unit srcUnit,
IN const ImageAttributes* imageAttributes = NULL,
IN DrawImageAbort callback = NULL,
IN VOID* callbackData = NULL)
BITMAP bmp;
void Mypicture::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CDC memdc;
memdc.CreateCompatibleDC(&dc);
memdc.SelectObject(&cbmp);
CRect r;
this->GetClientRect(&r);
//获得位图参数
long width,height;
cbmp.GetBitmap(&bmp);
width = bmp.bmWidth;
height = bmp.bmHeight;
dc.StretchBlt(0,0,r.Width(),r.Height(),&memdc,0,0,
bmp.bmWidth,bmp.bmHeight,SRCCOPY);
// Do not call CStatic::OnPaint() for painting messages
}