總結(jié)一下個人所知道的使用GDI 縮放圖片的方法. 方法一:最簡單的,使用GetThumbnailImage,這個方法的局限性對支持內(nèi)嵌縮略圖的圖片文件無效.因為MSDN中提到:如果圖片文件有內(nèi)嵌的縮略圖,那么就提取這個縮略圖返回,否則就縮放原圖片,不過我想對位圖還是安全的:Bitmap *image=newBitmap(L"MagicLinux.bmp");Image*pScaledImage=NULL;UINTnWidth=image->GetWidth()/2;UINTnHeight=image->GetHeight()/2;pScaledImage=image->GetThumbnailImage(nWidth,nHeight,NULL,NULL);deletepScaledImage;deleteimage; 方法二,使用Graphics::DrawImage,這樣還可以控制IntERPolationMode(插值模式,在縮放和旋轉(zhuǎn)時候使用),即可以控制縮放質(zhì)量高低.也可以通過Graphics對象做其他的控制.方法也比較簡單,但是卻費了我好久時間才研究出來,沒辦法,不熟悉GDI ,在MSDN中翻來翻去,:)Bitmap*ScaleBitmap(Bitmap*PBitmap,UINTnWidth,UINTnHeight){Bitmap*pTemp=newBitmap(nWidth,nHeight,pBitmap->GetPixelFormat());if(pTemp){Graphics*g=Graphics::FromImage(pTemp);if(g){//usethebestinterpolationmodeg->SetInterpolationMode(InterpolationModeHighQualityBicubic);g->DrawImage(pBitmap,0,0,nWidth,nHeight);deleteg;}