CDC::StretchBlt This method copies a bitmap from a source rectangle into a destination rectangle, and stretches or compresses the bitmap to fit the dimensions of the destination rectangle.BOOL StretchBlt ( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop ); 具体清查msdn
同上, int nSrcWidth, int nSrcHeight, int nWidth, int nHeight, 你要想变换长宽,注意以上几个参数就可以了!
int x, int y, int nWidth, int nHeight, 代表最终显示的起始坐标和尺寸。int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, 代表原图片的尺寸。
bm.LoadBitmap(IDB_BITMAP); //获得位图
CDC dcmem;
dcmem.CreateCompatibleDC(pDC); //建立内存描述表
CBitmap *pOldBm = dcmem.SelectObject(&bm);
dcmem.SelectObject(bm); pDC->BitBlt(0, 0, 460, 460,
&dcmem ,0, 0, SRCCOPY); //传送位图到设备,这个函数就可以设置大小
dcmem.SelectObject(pOldBm);
This method copies a bitmap from a source rectangle into a destination rectangle, and stretches or compresses the bitmap to fit the dimensions of the destination rectangle.BOOL StretchBlt (
int x,
int y,
int nWidth,
int nHeight,
CDC* pSrcDC,
int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
DWORD dwRop ); 具体清查msdn
int nSrcWidth,
int nSrcHeight, int nWidth,
int nHeight, 你要想变换长宽,注意以上几个参数就可以了!
int y,
int nWidth,
int nHeight,
代表最终显示的起始坐标和尺寸。int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
代表原图片的尺寸。