Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

StretchDIBits

Status
Not open for further replies.

maldini1010

Programmer
Jun 3, 2005
6
CA
Hi,

I am having problems with the StretchDIBits function. The w->length contains the size of the jpeg. And the w->p contains a pointer to the begining of the jpeg data. Nothing displays onto the screen just a white box. Any Help would be really appriciated.

HDC dc = BeginPaint( hwnd, &ps );

BITMAPINFO bmi;
memset(&bmi, 0, sizeof(bmi));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = 320;
bmi.bmiHeader.biHeight = -240; // top-down image
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 0;
bmi.bmiHeader.biCompression = BI_JPEG;
bmi.bmiHeader.biSizeImage = w->length;

int ww = StretchDIBits(dc, 0, 0, 32, 32, 0, 0, 32, 32, w->p, &bmi, DIB_RGB_COLORS, SRCCOPY);

EndPaint( hwnd, &ps );


Thanks
maldini
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top