General discussion


Parameter is not valid [stream to bitmap ]

By Sumesh.Nambron ·
I use to store images in a single file using, by adding each files stream into it and index of each file will be maintained in database. Now some of the images i could not save back to bitmap format i am getting an error like "Parameter invalid"

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Could be anything that

by Tony Hopkinson In reply to Parameter is not valid [s ...

Need some code, or at least a vague clue as to what language etc your are working with ....

Collapse -

Parameter is not valid [stream to bitmap ]

by Sumesh.Nambron In reply to Could be anything that


System.IO.FileStream fs2_EN;
System.IO.FileStream fs1_EN;
MemoryStream mStr_EN;
dir_EN = "C:\image1.jpg ";
fs1_EN = new System.IO.FileStream(dir_EN, FileMode.Open);
data1_EN = new byte[fs1_EN.Length];
fs1_EN.Read(data1_EN, 0, data1_EN.Length);
fs1_EN.Seek(0, SeekOrigin.Begin);
fs2_EN = new System.IO.FileStream(???, FileMode.Append);
fs2_EN.Seek(0, SeekOrigin.End);
fs2_EN.Write(data1_EN, 0, data1_EN.Length);


imgVal = ???72964#105860#75588#113802#81206???

byte[] data1
System.IO.FileStream outFileStream;
string[] imgPos;

outFileStream = new System.IO.FileStream(Path, System.IO.FileMode.Open);
data1 = new byte[outFileStream.Length];
imgPos = imgVal.Split('#');
for (int i = 0; i <= imgPos.GetUpperBound(0); i++)
fName =???C:\Image1.tif???;
imgByte = int.Parse(imgPos.ToString());
outFileStream.Seek(0, SeekOrigin.Current);
outFileStream.Read(data1, 0, imgByte);
mStr = new MemoryStream(data1, 0, imgByte);
bMap = new Bitmap(mStr);

Related Discussions

Related Forums