zl程序教程

您现在的位置是:首页 >  其它

当前栏目

CImage 缩放图片

图片 缩放
2023-06-13 09:12:24 时间

大家好,又见面了,我是你们的朋友全栈君。

BOOL CreateStretchImage(const CImage &src, CImage &dest, int stretchWidth, int stretchHeight)
{
    if (src.IsDIBSection())
    {
        dest.Create(stretchWidth, stretchHeight, 32);

        HDC destDC = dest.GetDC();
        ::SetStretchBltMode(destDC, HALFTONE);
        src.StretchBlt(destDC, 0, 0, stretchWidth, stretchHeight);
        dest.ReleaseDC();
        return TRUE;
    }
    return FALSE;
}

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/149663.html原文链接:https://javaforall.cn