BITMAP to IStream*

C

Cy

Hi all,

Is there any way to get an IStream* object out of a BITMAP?

Some background on the problem:
I am trying to grab the EXIF data from a JPEG image from managed code.
To do this, I have created an unmanaged DLL that accepts an HBITMAP
passed in via IntPtr. From the HBITMAP I am able to create a BITMAP
object. In order to access the data I am using IImageDecoder-
GetPropertyItem, but IImageFactory->CreateImageDecoder function
requires an IStream* which for the life of me I can't get.

I am basing my code on:
http://www.pocketpcdn.com/articles/...=57&atb.set(a_id)=6211&atb.perform(details)=&

Thanks for any help!
 
J

Jesse Houwing

Hello Cy,
Hi all,

Is there any way to get an IStream* object out of a BITMAP?

Some background on the problem:
I am trying to grab the EXIF data from a JPEG image from managed code.
To do this, I have created an unmanaged DLL that accepts an HBITMAP
passed in via IntPtr. From the HBITMAP I am able to create a BITMAP
object. In order to access the data I am using IImageDecoder-
requires an IStream* which for the life of me I can't get.

I am basing my code on:
http://www.pocketpcdn.com/articles/articles.php?&atb.set(c_id)=57&atb.
set(a_id)=6211&atb.perform(details)=&
Thanks for any help!

You can save the Image object to a new memorystream instance and pass that
to the function.
 
C

Cy

Hi Jesse, thanks for the reply.

Are you thinking save the Image object to a MemoryStream instance in
my managed project and pass that into my native DLL?
 
C

Cy

Hi Chris,

Yes exactly, but I'd like to do it without having to use OpenNETCF's
Smart Device Framework.
 
J

Jesse Houwing

Hello Cy,
Hi Jesse, thanks for the reply.

Are you thinking save the Image object to a MemoryStream instance in
my managed project and pass that into my native DLL?
Indeed.
 
G

Guest

Still not sure why you're tryiong to marshal to a native DLL shim. CF 2.0
supports COM interop, so you can directly call into the imaging control
(that's what we're doing in the SDF library).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
C

Cy

Yeah, I'm not sure why either :)

I've now implemented it via COM Interop and can successfully get EXIF
data in the PropertyItems for the Image, but am unable to get the GPS
info (which is what I really need). Chris, I noticed that GPS
PropertyTagIds are not supported in the OpenNET SDF library either,
but are defined on MSDN and in the Imaging.h file. Am I totally out of
luck on this?

Thanks for any help!
 
C

Cy

Ok, disregard that last one. Looks like the exif data in my test image
wasn't in there properly.

Yeah, I'm not sure why either :)

I've now implemented it via COM Interop and can successfully get EXIF
data in the PropertyItems for the Image, but am unable to get the GPS
info (which is what I really need). Chris, I noticed that GPS
PropertyTagIds are not supported in the OpenNET SDF library either,
but are defined on MSDN and in the Imaging.h file. Am I totally out of
luck on this?

Thanks for any help!

Still not sure why you're tryiong to marshal to a native DLL shim. CF 2.0
supports COM interop, so you can directly call into the imaging control
(that's what we're doing in the SDF library).

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded Worldwww.OpenNETCF.com
Hi Chris,
Yes exactly, but I'd like to do it without having to use OpenNETCF's
Smart Device Framework.
On Oct 3, 6:04 pm, "<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote:
Something like this?
http://blog.opennetcf.org/marteaga/ExtractingEXIFTagsUsingCompactFram...
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded Worldwww.OpenNETCF.com

Hi all,
Is there any way to get anIStream* object out of a BITMAP?
Some background on the problem:
I am trying to grab the EXIF data from a JPEG image from managed code.
To do this, I have created an unmanaged DLL that accepts an HBITMAP
passed in via IntPtr. From the HBITMAP I am able to create a BITMAP
object. In order to access the data I am using IImageDecoder-
GetPropertyItem, but IImageFactory->CreateImageDecoder function
requires anIStream* which for the life of me I can't get.
I am basing my code on:
http://www.pocketpcdn.com/articles/articles.php?&atb.set(c_id)=57&atb...
Thanks for any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top