Steaming Images to Web browser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone enlighten me on why I am being prompted to down load the
following file and why the file is not displaying my images? The images are
being streamed from an Array retreived from Active Directory...

//NEW CODE for displaying IMAGE from MEMORY
MemoryStream myStream; Byte[] imgByte =
(Byte[])myCollection; myStream = new MemoryStream(imgByte);

System.Drawing.Image _image =
System.Drawing.Image.FromStream(myStream);
System.Drawing.Image _newimage =
_image.GetThumbnailImage(50, 50, null, new System.IntPtr());
Response.ContentType = "image/jpg";
_newimage.Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg);


When I am prompted to say I recieve garbage from the streaming image.
 
Hi,

A few ideas:
a) Try using Response.Clear() before the call to _newimage.Save()
b) Try saving the image to a temp file and then using Response.WriteFile()
c) Try using Response.End() after the call to _newimage.Save()

Regards -Octavio
 
Back
Top