PC Review


Reply
Thread Tools Rate Thread

Bitmap(stream) and ArgumentException

 
 
Federico Del Bene
Guest
Posts: n/a
 
      29th Apr 2005
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?TGlvbmVsIFJleWVybw==?=
Guest
Posts: n/a
 
      29th Apr 2005
Hi Federico,

The problem might be that Bitmap on Pocket PC have different headers than
bitmap on PC.
You can try to see the different bitmap header types on this page:
http://msdn.microsoft.com/library/de...tmaps_7ltf.asp

Lionel Reyero



"Federico Del Bene" wrote:

> 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
>
>
>

 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      29th Apr 2005
What is the stream format? BMP? JPG? PNG? What kind of device? Do you have
Service Pack 3 installed?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Federico Del Bene" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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
>


 
Reply With Quote
 
Federico Del Bene
Guest
Posts: n/a
 
      30th Apr 2005
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.

"Alex Feinman [MVP]" <(E-Mail Removed)> wrote:

> What is the stream format? BMP? JPG? PNG? What kind of device? Do you have
> Service Pack 3 installed?
>
> --
> Alex Feinman



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT: ArgumentException on creating bitmap mrabie Microsoft Dot NET Compact Framework 4 25th Nov 2008 10:19 AM
ArgumentException @ Image.FromStream(stream) halise irak via .NET 247 Microsoft Dot NET 1 11th Apr 2005 09:02 AM
ArgumentException @ Image.FromStream(stream) halise irak via .NET 247 Microsoft Dot NET Framework Forms 2 10th Apr 2005 09:22 PM
ArgumentException: Invalid parameter used at Bitmap.SetPixel halise Microsoft C# .NET 3 8th Mar 2005 12:02 PM
Re: System.ArgumentException: Stream was not writable? Craig Deelsnyder Microsoft ASP .NET 1 19th Jul 2004 08:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 AM.