Bitmap Constructor throwing an exception

G

Guest

I am trying to load a bitmap from an embedded resource (or from the disk, I get the same problem).
When I try to create a new Bitmap with either of the following lines

b = new Bitmap(fullFileName); //fullFileName looks like \Program Files\Windows\MyProgram\Image.gif, and the file definitely exists

or

b = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(ImageToLoad)); //where ImageToLoad looks like "MyAssemblyName.Image.gif" and It is an embedded resource.

I have this same exact code working on a PocketPC 2002 Project without a problem. I am now trying to get it to work on a project running on WinCE .NET 4.2 on a device called a "MidasPAD". I have the Midas SDK installed that came with the device.

When it hits the new Bitmap line, I get an exception being thrown. The exception is of type "Exception", and the Message Property's value is "Exception".

If there was a meaningful message, maybe I would be able to come to some sort of conclusion, but to no avail.

Anyone have any ideas?
 
C

Chris Tacke, eMVP

Does the CE 4.2 image have imgdecmp.dll? I suspect it doesn't.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Brent Lang said:
I am trying to load a bitmap from an embedded resource (or from the disk, I get the same problem).
When I try to create a new Bitmap with either of the following lines

b = new Bitmap(fullFileName); //fullFileName looks like \Program
Files\Windows\MyProgram\Image.gif, and the file definitely exists
or

b = new
Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(ImageToLoad
)); //where ImageToLoad looks like "MyAssemblyName.Image.gif" and It is an
embedded resource.
I have this same exact code working on a PocketPC 2002 Project without a
problem. I am now trying to get it to work on a project running on WinCE
..NET 4.2 on a device called a "MidasPAD". I have the Midas SDK installed
that came with the device.
When it hits the new Bitmap line, I get an exception being thrown. The
exception is of type "Exception", and the Message Property's value is
"Exception".
If there was a meaningful message, maybe I would be able to come to some
sort of conclusion, but to no avail.
 
G

Guest

Thank you for your quick response. I looked for the file imgdecmp.dll and I do not see it on the device. I read that this must be included as part of the OS Image, is this true?. Since I do not have it currently installed, how can I get that file onto the device, so that I can load images?
 
A

Alex Yakhnin [MVP]

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