int iWidth, iHeight, iBytesWidth;
iWidth = 500;
iHeight = 500;
float dTemp = 960;
iBytesWidth = (iWidth % 4) ? (iWidth / 4 + 1) * 4 : iWidth;
HANDLE hMem = GlobalAlloc(GMEM_MOVEABLE, iBytesWidth * iHeight * 3);
BYTE *Image = (BYTE*)GlobalLock(hMem);//new BYTE[iBytesWidth * iHeight * 3];
//memset(Image, 100, iBytesWidth * iHeight * 3);
BITMAPINFO bmi;
ZeroMemory(&bmi, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = iWidth;
bmi.bmiHeader.biHeight = iHeight;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24;
bmi.bmiHeader.biCompression = BI_RGB;
::SetDIBitsToDevice(pDC->GetSafeHdc(), 0, 0, iWidth, iHeight, 0, 0, 0, iHeight, Image, &bmi, DIB_RGB_COLORS);
GlobalUnlock(hMem);
GlobalFree(hMem);
delete []Image;SPI_GETWHEELSCROLLLINES
iWidth = 500;
iHeight = 500;
float dTemp = 960;
iBytesWidth = (iWidth % 4) ? (iWidth / 4 + 1) * 4 : iWidth;
HANDLE hMem = GlobalAlloc(GMEM_MOVEABLE, iBytesWidth * iHeight * 3);
BYTE *Image = (BYTE*)GlobalLock(hMem);//new BYTE[iBytesWidth * iHeight * 3];
//memset(Image, 100, iBytesWidth * iHeight * 3);
BITMAPINFO bmi;
ZeroMemory(&bmi, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = iWidth;
bmi.bmiHeader.biHeight = iHeight;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24;
bmi.bmiHeader.biCompression = BI_RGB;
::SetDIBitsToDevice(pDC->GetSafeHdc(), 0, 0, iWidth, iHeight, 0, 0, 0, iHeight, Image, &bmi, DIB_RGB_COLORS);
GlobalUnlock(hMem);
GlobalFree(hMem);
delete []Image;SPI_GETWHEELSCROLLLINES