maldini 0 Newbie Poster

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 );

<< moderator edit: added [code][/code] tags >>


Maldini

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.