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:
C#
String RightIris="AAAADGpQICANCocKAAAAFGZ0eXBqcDIgAAAAAGpwMiAAAAAtanAyaAAAABZpaGRyAAAF3AAABkAAAQcHAAAAAAAPY29scgEAAAAAABEAAkmHanAyY/9P/1EAKQAAAAAGQAAABdwAAAAAAAAAAAAABkAAAAXcAAAAAAAAAAAAAQcBAf9SAAwAAAABAAUEBAAB/1wAE0BASEhQSEhQSEhQSEhQSEhQ/5AACgAAAAJJLQAB/5Pff6aAt38yOTwGTMsCjVHuTLukIAjqqLmiP8++vJHSHL8ErUX4Y12A2VGLz5plzCK6K9rABQCVXe4MMtyUyHWRLowJ5afEYEp0ZtfExNJ5AQ9xRryIEFIsgOgE/ADPh8va4AIftcQCaBnBlmHANnl0IUWZQnwvX8pIO3f7+4jUePM2madk5v4LwzojY4TnZvFT1Wh/+7Xcetv0mneJo4TXdhH/Fj2LNwafela0Fd7i2vPbnloD6yuYK5+v4hzn/mdsT2XGPB+ABIlaTZ0PcWyoX0ZnLZI9A467pEnh5gwfyVvn+JGp2hXJ88l5UmAAAAABhIS/5SKZBb0hT5Uo1Yn3TunIKjWQLuycriqrePQ9tJ06ZeClRLc9Jq/8BOTDdTn4LnRYAhZ894MjI6wN0FDZbJVm2QQAAAAYSEv49nJit9pulHzJGv5IiIoL3pLDQwlnHUCTddlSELYxp5jqY+oU3yfvjM49IW0KVbCcvJpR";


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()
C#
{
TestLeftFingure();

}


it show the error:perameter is not valid


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

1 solution

Since the error will be on the line:
C#
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