-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: CSharpMadhu
Message 1 in Discussion


This code snippet below is used to bind a image to a picturebox from 
a MemoryStream.
 
if(imageByteArray != null)
{
MemoryStream stmImageInMS = new MemoryStream(); 
stmImageInMS.Write(imageByteArray ,0,imageByteArray.Length); 
PictureBox.Image = Image.FromStream(stmImageInMS); 
} 
 
This Code throws the "Invalid parameter used." exception
Actually there is no problem in this code in normal circumstances.
i.e., when imageByteArray is loaded with data from a image file in the local 
hard disk then the code works fine.
 
But when I capture a image directly from a scanner and then load 
imageByteArray with this scanner image, then the above exception is thrown.
 
I stepped thro the code and found that stmImageInMS was behaving
properly and had image data in its buffer. The exception occurs when 
i try to do Image.FromStream(stmImageInMS)
 
What could be the problem?

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to