Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, this is geetha

i am trying to read the image data into a file which is giving me the int values b/w 0 to 255. Then i modify this data file. again if i try to redraw the image by reading the modified data it is throwing an error of Parameter invalid for the line..

Image img=Image.Fromstream(ms,true);   


can you plz.. tell me where i am going wrong....
Posted
Updated 5-May-10 1:09am
v2

Your question does not specify much but here's a few ideas i had:

- What exactly are you modifying? Are you not corrupting the image?

- Make sure that the MemoryStream starting point is at zero (At the beginning of the stream).

C#
ms.Position = 0;
 
Share this answer
 
v2
Comments
Christian Graus 5-May-10 4:59am    
Imge absolutely has a static FromStream method.
Jordy "Kaiwa" Ruiter 5-May-10 5:02am    
Haha how silly of me.. The application I was working on had a property called Image and it did not appear in my list :P
Your first mistake is not giving us the actual error message, or showing us what ms is. I suspect at the core, your error is that ms does not contain a valid image after you finish modifying it. You'd have to post the code for us to know more.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900