Josema,
If you want to show the image back in internet explorer, you probably
don't want to load the bytes into an Image (Bitmap) object. Rather, you
need to return an IMG tag which points to an ASP.NET page. This tag would
have a SRC attribute that has the url of the page, along with an identifier
of some sort in the query string which you can use to fetch the contents of
the image from the database.
Then, in the other ASP.NET page, change the content type of the response
to "image/jpeg" (or whatever your format is), and then fetch the bytes from
the database based on the identifer in the query string. Once you have the
bytes, clear the response stream (the response needs to be buffered for
this, I believe) and then write the bytes in the response stream.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Josema" <Je******@ocu.org> wrote in message
news:01**********************************@microsof t.com...
Hi,
I get from database a field of type binary (its a gif image) into byte[]
until here no problem, cause i veryfied that the binary its stored into
the
byte[] variable (called arrayb in my application).
Im trying show into Internet explorer this byte[] (arrayb its the name of
the variable) this way:
1) MemoryStream imgStream=new MemoryStream(arrayb,0,arrayb.Length, false,
true);
2) System.Drawing.Image tmpimg=System.Drawing.Image.FromStream(imgStream);
Question 1) Why im getting an error in the step 2 that says?: Invalid
parameter used.
Question 2) How could i show the image into a HtmlGenericControl?
--
Thanks a lot
Regards.
Josema