这里说下网上的解决办法:
将参数srchight设置为负数,我试了下不行。或者将BITMAPINFO里面的高设置为负,这个可行,但是都不是理想的方法。
我想了种办法,直接将图片像素数据倒置,也解决了该问题。
附倒置代码:
int w = pMain->m_bmpRenderSource.GetWidth();
int h = pMain->m_bmpRenderSource.GetHeight();
DWORD * p_b = (DWORD*)pMain->m_bmpRenderSource.GetDIBits();
DWORD * p_e = (DWORD*)pMain->m_bmpRenderSource.GetDIBits()+(h-1)*w;
for (int i=0; i<h/2; i++)
{
for (int j=0; j<w; j++)
{
DWORD t = *(p_b+i*w+j);
*(p_b+i*w+j) = *(p_e-i*w+j);
*(p_e-i*w+j) = t;
}
}