Sometimes in firefox i can’t view dynamic image in picturebox even refresing a page (biytearray.lenght>0).
Fails more in mobile devices!
Works better in internet explorer.
Even i tried to open directly url link (blank page/image) and after a few tries, it finally shows the image:
My code is like:
if (_imageByteArray != null && _imageByteArray.Length > 0)
Text = _imageByteArray.Length.ToString();
var imageStream = new MemoryStream(_imageByteArray);
var image = Image.FromStream(imageStream);
picPhoto.Image = image;
picPhoto.Image = null;
Text = “null image”;
Even if I load another byteArrayImage … lenght > 0…
Thanks in advance!
How big is the stream?
Try to load the stream in the image like this:
var image = Image.FromStream(stream);
this.picture.Image = new Bitmap(image);
When you use Image.FromStream() directly the image may not get fully loaded, System.Graphics may keep the stream open and read the image as needed. Usually new Bitmap(image) solves this issue – if this is the issue.
Please login first to submit.