-1

I am working with WPD (Windows Portable Devices) API, and I have a problem. I have obtained images, video, mp3 objects on a device, and now I want to show a thumbnail of images on CListCtrl. I have used the following to get Stream of image objects:

pd_resource->GetStream(objectID,WPD_RESOURCE_THUMBNAIL, STGM_READ, &optimal_transfer_size, &src_data_stream)

How do I convert this Stream resource to CBitmap?

Please help me! Thanks so much!

Richard
  • 8,961
  • 3
  • 38
  • 47
Tiktac
  • 966
  • 1
  • 12
  • 32

1 Answers1

1

I have found a resource here that shows how to convert IStream to HBITMAP.

Hope this helps: http://mariusbancila.ro/blog/2011/08/04/display-images-as-you-type-in-cpp/

Gautam Jain
  • 6,789
  • 10
  • 48
  • 67
  • Thank's goths, but i want to ask again that above the way to get images's thumbnail is a true idea? – Tiktac Mar 07 '14 at 05:41
  • For that it is better to use GetSupportedResources before calling GetStream to ensure that WPD_RESOURCE_THUMBNAIL is supported. – Gautam Jain Mar 07 '14 at 07:37
  • OK, i used above GetStream function to get stream data, output is src_data_stream, after that i call to function on link you shared, IWICBitmapSource* ipBitmap= LoadBitmapFromStream(src_data_stream), but ipBitmap return NULL, can you help me? – Tiktac Mar 07 '14 at 07:52
  • I think first you must try loading full bitmap to determine where the problem is. Whether with thumbnail or with the process of loading bitmap. – Gautam Jain Mar 07 '14 at 09:29
  • Can you guide me detail? – Tiktac Mar 07 '14 at 09:36
  • Sorry. Can't help in detail. – Gautam Jain Mar 07 '14 at 10:06