MFC 图片怎么实现放大缩小功能

2025-04-08 02:19:49
推荐回答(1个)
回答1:

BOOL StretchBlt(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of destination upper-left corner
int nYOriginDest, // y-coord of destination upper-left corner
int nWidthDest, // width of destination rectangle
int nHeightDest, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of source upper-left corner
int nYOriginSrc, // y-coord of source upper-left corner
int nWidthSrc, // width of source rectangle
int nHeightSrc, // height of source rectangle
DWORD dwRop // raster operation code
);
你用这个函数就是可以了,自己先创建一个BITMAP然后将你要放大的图片选到BITMAP中,这样你就是可以操作你的画布了,在将图片输出