943,978 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3036
  • C RSS
Jun 8th, 2005
0

StretchDIBits

Expand Post »
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.

  1. HDC dc = BeginPaint( hwnd, &ps );
  2.  
  3. BITMAPINFO bmi;
  4. memset(&bmi, 0, sizeof(bmi));
  5. bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
  6. bmi.bmiHeader.biWidth = 320;
  7. bmi.bmiHeader.biHeight = -240; // top-down image
  8. bmi.bmiHeader.biPlanes = 1;
  9. bmi.bmiHeader.biBitCount = 0;
  10. bmi.bmiHeader.biCompression = BI_JPEG;
  11. bmi.bmiHeader.biSizeImage = w->length;
  12.  
  13. int ww = StretchDIBits(dc, 0, 0, 32, 32, 0, 0, 32, 32, w->p, &bmi, DIB_RGB_COLORS, SRCCOPY);
  14.  
  15. EndPaint( hwnd, &ps );
<< moderator edit: added [code][/code] tags >>


Maldini
Reputation Points: 10
Solved Threads: 0
Newbie Poster
maldini is offline Offline
6 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: makes pointer from integer without a cast
Next Thread in C Forum Timeline: A simple query





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC