Click here to Skip to main content
15,916,180 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:

public void TestLeftFingure()
 byte[] b = Convert.FromBase64String(RightIris);
 MemoryStream ms = new MemoryStream();
 ms = new MemoryStream(b);
 //ms.Write(b, 0, b.Length);
 // pictureBox4.Image.Save(@"C:/Photo/LeftFingure", System.Drawing.Imaging.ImageFormat.Jpeg);
 Image img = Image.FromStream(ms);
 pictureBox4.Image = img;
 pictureBox4.Image.Save(@"C:/Photo/LeftFingure", ImageFormat.Jpeg);

call this method in button click()


it show the error:perameter is not valid

[edit]Code block added - OriginalGriff[/edit]
Updated 19-Mar-12 21:53pm

1 solution

Since the error will be on the line:
ms = new MemoryStream(b);
You need to look at the code you used to generate the RightIris string value. A quick check with a hex editor says it is not a JPEG image even when converted from Base64 - it lacks a JPEG header. Since the rest of the code it referencing .jpeg files, I assume it should be one as well.
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