Thanks, I did like that:
Code:
HBITMAP hPicture;
VOID *pvBits;
LPBITMAPINFO bmp_info;
bmp_info = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
bmp_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmp_info->bmiHeader.biWidth = 176;//10;//4;//176; // width should be divided by 4
bmp_info->bmiHeader.biHeight = 144; // should be maybe minus mark to make it right
bmp_info->bmiHeader.biPlanes = 1;
bmp_info->bmiHeader.biBitCount = 8; // 24bit colors
bmp_info->bmiHeader.biCompression = BI_RGB; // No compression
bmp_info->bmiHeader.biClrUsed = 0; // When set to 0, colors used is counted on biBitCount
//create a bitmap with 176X144, 8-bit
hPicture = CreateBitmap(176,144,1,8,&pvBits);
//set the bits to bitmap handle with pictureBuffer
SetDIBits(hdc,hPicture,49,144,&pictureBuffer,bmp_info,DIB_RGB_COLORS);
bmp_hdc = CreateCompatibleDC(hdc);
SelectObject(bmp_hdc,hPicture);
BitBlt(hdc,19,49,176,144,bmp_hdc,0,0,SRCCOPY);
/*pictureBuffer contains each pixel value,
BYTE picturebuffer [144][176][3];*/
I am not sure if I use those parameters correctly, but It just could not display the picture,what's wrong with them? Thanks