问题描述:
有一个静态控件(矩形rc大小为 960*450,HDC句柄名为 hDC),要对它进行绘制操作。
建立内存DC (hMemDC),同时将坐标系映射为 700*350,将原点移动到了 (100,50)位置。
这样绘制完成后,BitBlt回原来矩形。。
结果,绘制区域绘制的图形没有问题,但只缩小到了 700*350大小。。没有充满原来矩形。。
是不是BitBlt的问题的呢?附BitBlt函数:
::BitBlt(hDC,rc.left, rc.top,rc.right-rc.left, rc.bottom-rc.top,
hMemDC,
-( 100 )*700/960,-( 50 )*350/450,
SRCCOPY
);
还是说与坐标映射的相关知识有关系呢?
有一个静态控件(矩形rc大小为 960*450,HDC句柄名为 hDC),要对它进行绘制操作。
建立内存DC (hMemDC),同时将坐标系映射为 700*350,将原点移动到了 (100,50)位置。
这样绘制完成后,BitBlt回原来矩形。。
结果,绘制区域绘制的图形没有问题,但只缩小到了 700*350大小。。没有充满原来矩形。。
是不是BitBlt的问题的呢?附BitBlt函数:
::BitBlt(hDC,rc.left, rc.top,rc.right-rc.left, rc.bottom-rc.top,
hMemDC,
-( 100 )*700/960,-( 50 )*350/450,
SRCCOPY
);
还是说与坐标映射的相关知识有关系呢?
[编辑本段]参数
hdcDest:指向目标设备环境的句柄。
nXDest:指定目标矩形区域左上角的X轴逻辑坐标。
nYDest:指定目标矩形区域左上角的Y轴逻辑坐标。
nWidth:指定源和目标矩形区域的逻辑宽度。
nHeight:指定源和目标矩形区域的逻辑高度。
hdcSrc:指向源设备环境的句柄。
nXSrc:指定源矩形区域左上角的X轴逻辑坐标。
nYSrc:指定源矩形区域左上角的Y轴逻辑坐标。:有问题
dwRop:指定光栅操作代码。这些代码将定义源矩形区域的颜色数据,如何与目标矩形区域的颜色数据组合以完成最后的颜色。
HDC hdcDest, // handle to destination device context
int nXOriginDest, // x-coordinate of upper-left corner of dest. rectangle
int nYOriginDest, // y-coordinate of upper-left corner of dest. rectangle
int nWidthDest, // width of destination rectangle
int nHeightDest, // height of destination rectangle
HDC hdcSrc, // handle to source device context
int nXOriginSrc, // x-coordinate of upper-left corner of source rectangle
int nYOriginSrc, // y-coordinate of upper-left corner of source rectangle
int nWidthSrc, // width of source rectangle
int nHeightSrc, // height of source rectangle
DWORD dwRop // raster operation code
);