Error loading bitmap created with OpenNETCF.GDIInternals example

L

Lump Kin

I'm trying to load a bitmap created using the GDIInternals
BitmapHandler.SaveBitmap function but it fails everytime.

The following code is taken from the sample BitmapFun project and
slightly modified to show my issue.

String lsPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
// Load gif
Bitmap b = new Bitmap( lsPath + "\\test.gif");

// Get CF internal data structure
InMemoryBitmap bmp = BitmapHandler.GetInMemoryBitmap(b);

// Save bitmap bits to a file
BitmapHandler.SaveBitmap(bmp, @lsPath + "\\out.bmp");

// Load saved bitmap
Bitmap c = new Bitmap( lsPath + "\\out.bmp");


When it attemps to perform the "new bitmap" function on the saved
bitmap, I get the following error -

"An unhandled exception of type 'System.ArgumentException' occurred in
System.Drawing.dll

Additional information: Argument Exception"


However, the bitmap will load fine if viewed on the desktop. Any
clues on how to get around this problem would be greatly appreciated.

Thx
 
A

Alex Feinman

Since I wrote that GDIInternals code, I suppose I'm the
one who should take care of this :)
Could you email me the .bmp file that you are getting?

Alex Feinman
-----Original Message-----
I'm trying to load a bitmap created using the GDIInternals
BitmapHandler.SaveBitmap function but it fails everytime.

The following code is taken from the sample BitmapFun project and
slightly modified to show my issue.

String lsPath = Path.GetDirectoryName (Assembly.GetExecutingAssembly().GetModules()
[0].FullyQualifiedName);
// Load gif
Bitmap b = new Bitmap( lsPath + "\\test.gif");

// Get CF internal data structure
InMemoryBitmap bmp = BitmapHandler.GetInMemoryBitmap(b);

// Save bitmap bits to a file
BitmapHandler.SaveBitmap(bmp, @lsPath + "\\out.bmp");

// Load saved bitmap
Bitmap c = new Bitmap( lsPath + "\\out.bmp");


When it attemps to perform the "new bitmap" function on the saved
bitmap, I get the following error -

"An unhandled exception of
type 'System.ArgumentException' occurred in
 
L

Lump Kin

X-Scale 200mhz and 400mhz

Thx!

Chris Tacke said:
WHat processor does the device have?

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

Lump Kin said:
I'm trying to load a bitmap created using the GDIInternals
BitmapHandler.SaveBitmap function but it fails everytime.

The following code is taken from the sample BitmapFun project and
slightly modified to show my issue.

String lsPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQ
ualifiedName);
// Load gif
Bitmap b = new Bitmap( lsPath + "\\test.gif");

// Get CF internal data structure
InMemoryBitmap bmp = BitmapHandler.GetInMemoryBitmap(b);

// Save bitmap bits to a file
BitmapHandler.SaveBitmap(bmp, @lsPath + "\\out.bmp");

// Load saved bitmap
Bitmap c = new Bitmap( lsPath + "\\out.bmp");


When it attemps to perform the "new bitmap" function on the saved
bitmap, I get the following error -

"An unhandled exception of type 'System.ArgumentException' occurred in
System.Drawing.dll

Additional information: Argument Exception"


However, the bitmap will load fine if viewed on the desktop. Any
clues on how to get around this problem would be greatly appreciated.

Thx
 
L

Lump Kin

zipped and emailed to your reply address and hotmail address (not sure
which you use).

Thx a bunch!!
lmpk

Alex Feinman said:
Since I wrote that GDIInternals code, I suppose I'm the
one who should take care of this :)
Could you email me the .bmp file that you are getting?

Alex Feinman
-----Original Message-----
I'm trying to load a bitmap created using the GDIInternals
BitmapHandler.SaveBitmap function but it fails everytime.

The following code is taken from the sample BitmapFun project and
slightly modified to show my issue.

String lsPath = Path.GetDirectoryName (Assembly.GetExecutingAssembly().GetModules()
[0].FullyQualifiedName);
// Load gif
Bitmap b = new Bitmap( lsPath + "\\test.gif");

// Get CF internal data structure
InMemoryBitmap bmp = BitmapHandler.GetInMemoryBitmap(b);

// Save bitmap bits to a file
BitmapHandler.SaveBitmap(bmp, @lsPath + "\\out.bmp");

// Load saved bitmap
Bitmap c = new Bitmap( lsPath + "\\out.bmp");


When it attemps to perform the "new bitmap" function on the saved
bitmap, I get the following error -

"An unhandled exception of
type 'System.ArgumentException' occurred in
System.Drawing.dll

Additional information: Argument Exception"


However, the bitmap will load fine if viewed on the desktop. Any
clues on how to get around this problem would be greatly appreciated.

Thx
.
 

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