GDI+更改bmp图片大小~

Gdiplus::Bitmap * CSelfFacePicSetWnd::ScaleBitmap(Gdiplus::Bitmap * pBitmap,UINT nWidth,UINT nHeight)

{

 Gdiplus::Bitmap * pTemp = new Gdiplus::Bitmap(nWidth,nHeight,pBitmap->GetPixelFormat());

 if( pTemp )

 {

  Gdiplus::Graphics * g = Gdiplus::Graphics::FromImage(pTemp);

  if( g )

  {

   // use the best interpolation mode

   g->SetInterpolationMode(Gdiplus::InterpolationModeHighQualityBicubic);

   g->DrawImage(pBitmap,0,0,nWidth,nHeight);

   delete g;

  }

 }

 return pTemp;

}

你可能感兴趣的:(知识积累)