用如上方式画图,为什么画出来的图位置分别往左和往下偏移了16个像素??
GetClientRect(&rc);
BITMAPINFO bmi;
// Initialize the BITMAPINFO.
memset(&bmi, 0, sizeof(bmi));
bmi.bmiHeader.biSize = sizeof(bmi);
bmi.bmiHeader.biWidth = m_un32ImageWidth;
bmi.bmiHeader.biHeight = m_un32ImageHeight; // top-down image
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = m_un32ImageBits;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = 0;
int nResult = ::StretchDIBits(
dc.m_hDC,
rc.left,//rc.right-rc.left,
rc.top,
rc.left + rc.right,
rc.bottom - rc.top,
0,
0,
m_un32ImageWidth,
m_un32ImageHeight,
m_pImageBytes,
//m_pBmp,
&bmi,
DIB_RGB_COLORS,
SRCCOPY);
确定
// un32ImageWidth = rc,width
// m_un32ImageHeight = rc.heigth
// m_un32ImageBits = 24
用如上方式画图,为什么画出来的图位置分别往左和往下偏移了16个像素??