Bitmap(stream) and ArgumentException

  • Thread starter Thread starter Federico Del Bene
  • Start date Start date
F

Federico Del Bene

I have this piece of code perfectly working on the full framework:

-----------------
byte[] b = binaryReader.ReadBytes(145206);
MemoryStream ms = new MemoryStream(b);
ms.Seek(0,System.IO.SeekOrigin.Begin);
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(ms);
-----------------

But on the compact one it generates an ArgumentException on the last line.
Any idea about the problem?

Thanks,
Federico Del Bene
 
What is the stream format? BMP? JPG? PNG? What kind of device? Do you have
Service Pack 3 installed?
 
I just found out that it is a problem of the Pocket PC 2003 First Edition
Emulator. In the Second Edition's one all work fine.

Btw, it was a BMP, and the header was the same on the PocketPC and on the
PC.
 
Back
Top