CreateBitmapFromImage
(1)
CreateImageFromFile
(1)
BitmapData.scan0
(1)
StretchDIBits
(1)
IImagingFactory
(1)
IBitmapImage
(1)
APIs
(1)
BitmapData
(1)

Converting stream to hBitmap

Asked By Afikim via PocketPCJunkies.com
06-Nov-09 01:41 PM
Hello

I need to know how to convert a jpeg stream to bitmap.  It will be used for
IpCam.

The picturebox that displays the jpeg is loading only from bitmaps image.
fromhbitmap.

Thanks

Eli

--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-programming/200911/1

if it is the JPEG image, you can use imaging APIs.

Vinoth replied to Afikim via PocketPCJunkies.com
11-Nov-09 12:04 PM
if it is the JPEG image, you can use imaging APIs.
Note:
Imaging APIs are COM objects.
Following Procedure helps you in creating the Bitmap.
1) call IImagingFactory::CreateImageFromFile () to get the IImage interface
from the jpg file.

2) pass the IImage to
IImagingFactory::IImagingFactory::CreateBitmapFromImage () to get the

IBitmapImage inteface.
3) Call the IBitmapImage::LockBits() to get the BitmapData struture.
BitmapData.scan0 is the data

bytes.
4) Create a BITMAPINFO structure and pass this with  BitmapData.scan0 to
StretchDIBits() to draw on screen.

Hope this will give you an idea to draw the JPEG image.
--
vinoth.R
Technical Lead
e-consystems India Pvt Ltd
www.e-consystems.com
My Articles & blogs:
http://www.windowsfordevices.com/articles/AT8185724467.html
http://www.e-consystems.com/portingwincepxa255.asp
http://e-consystems.com/gprsconnectivity.asp
http://vinoth-vinothblog.blogspot.com
http://e-consystems.com/blog
Post Question To EggHeadCafe