BITMAPINFO m_bmphdr={0};
DWORD dwBmpHdr = sizeof(BITMAPINFO);
m_bmphdr.bmiHeader.biBitCount = 24;
m_bmphdr.bmiHeader.biClrImportant = 0;
m_bmphdr.bmiHeader.biSize = dwBmpHdr;
m_bmphdr.bmiHeader.biSizeImage = 0;
m_bmphdr.bmiHeader.biWidth = nWidth;
m_bmphdr.bmiHeader.biHeight = nHeight;
m_bmphdr.bmiHeader.biXPelsPerMeter = 0;
m_bmphdr.bmiHeader.biYPelsPerMeter = 0;
m_bmphdr.bmiHeader.biClrUsed = 0;
m_bmphdr.bmiHeader.biPlanes = 1;
m_bmphdr.bmiHeader.biCompression = BI_RGB;
HDC hdc=GetDC(cdlg->m_hWnd);
CRect rect;
cdlg->GetClientRect(&rect);
//CHANGE_ENDIAN_PIC(g_pchRgbBuf,nWidth, nHeight, 24);
/*DrawDibDraw(mDrawDib,hdc,0,
0,
rect.Width(),
rect.Height(),
&m_bmphdr.bmiHeader, g_pchRgbBuf,0,0,nWidth,nHeight,0);*/
SetStretchBltMode(hdc, HALFTONE);
int nResult = StretchDIBits(hdc,
0,0,
rect.Width(),rect.Height(),
0, 0,
nWidth, nHeight,
g_pchRgbBuf,
&m_bmphdr,
DIB_RGB_COLORS,
SRCCOPY);
/*int nResult = SetDIBitsToDevice(hdc,
0,0,
rect.Width(),rect.Height(),
0, 0,
nWidth, nHeight,
g_pchRgbBuf,
&m_bmphdr,
DIB_RGB_COLORS
); */
ReleaseDC(cdlg->m_hWnd,hdc);