Last post Sep 05, 2006 06:47 PM by blumonde
Mar 03, 2006 09:02 PM|aaj23|LINK
Sep 05, 2006 06:47 PM|blumonde|LINK
[quote user="aaj23"]I seem to be having problems getting a photo from a users computer and converting it to an image so I can use GDI functions and then back to a stream so that I can store it into a database. Here is the code I have - I don't get any errors
when running it, but the image is never usable.
if(pic.PostedFile != null)
string picType = pic.PostedFile.ContentType.ToString();
int picSize = pic.PostedFile.ContentLength;
System.Drawing.Image picTemp = System.Drawing.Image.FromStream(pic.PostedFile.InputStream);
System.Drawing.Image imgPhototemp = FixedSize(picTemp, 200, 250);
MemoryStream picStream = new MemoryStream();
int picLength = (int)picStream.Length;
byte picBuffer = new byte[picLength];
addRow.Pic = picBuffer;
Any help would be greatly appreciated. Thanks!
I am trying to upload pics to an image field of my database as well. Have you found a solution to your issue above? Thanks.