CImage进行图片的缩放

void SmallerPicture(CString csSource, CString csDest)
{
    CImage imageOld;
    CImage imageNew;

    imageOld.Load(csSource);
    imageNew.Create(imageOld.GetWidth()/2, imageOld.GetHeight()/2, 32);

    HDC dcNew = imageNew.GetDC();

    SetStretchBltMode(dcNew,HALFTONE); 
    imageOld.StretchBlt(dcNew, 0, 0, imageOld.GetWidth()/2, imageOld.GetHeight()/2);

    imageNew.Save(csDest) ;
    imageNew.ReleaseDC();
}

 

转载于:https://www.cnblogs.com/nangning/p/3336224.html

你可能感兴趣的:(CImage进行图片的缩放)