i am writing code for byteArray convert into image or bitmap
code is below
ArrayList pics = tw.TransferPictures();
EndingScan();
tw.CloseSrc();
picnumber++;
for (int i = 0; i < pics.Count; i++)
{
IntPtr img = (IntPtr)pics[i];
PicForm newpic = new PicForm(img);
int a = img.ToInt32();
byte[] byteArray = new byte[a];
MemoryStream ms = new MemoryStream(byteArray);
Bitmap returnImage = new Bitmap(ms);
returnImage.Save("D:\\UploadArchive\\" + i + ".jpg");
newpic.MdiParent = this;
int picnum = i + 1;
newpic.Text = "ScanPass" + picnumber.ToString() + "_Pic" + picnum.ToString();
newpic.Show();
}
when compiler excute this line
Bitmap returnImage = new Bitmap(ms);
exception occures " Parameter is not valid "
reply soon
Thanks