[dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Mon Jun 2 23:07:40 CDT 2008


Hi All,

Here is the solution on my test site -
http://shamils-4.hosting.parking.ru/Pics : as it's written in the article
referred below to show a picture on ASP.NET Image control one has to create
special helper .aspx page and pass to this page a parameter defining the
source of the image - the latter could come from anywhere (file, database,
external source (e.g. web service) etc.) or even be generated using
System.Drawing...

...generated image is converted into array of bytes and then it's returned
as binary stream within helper .aspx page...

...that sounds tricky but it works and I didn't find any less complicated
solution - if anybody knows/will find another solution, which uses somehow
an instance of HttpRequest/HttpResponse manually (in custom code) created
and filled with an image bytes' stream - that would be useful here...

Thank you.

--
Shamil



-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil
Salakhetdinov
Sent: Sunday, June 01, 2008 12:23 PM
To: 'Access-D - VB'
Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web
ImageControl

Hi All,

In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get
it downloaded/streamed it from somewhere but into memory) and then display
it on an Image control *without write it to file*.

I have found this sample
(http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx
), which gets image from db and displays them on Image control in a grid: I
think I can adapt it to my case but if somebody can point m eon ready to use
sample fitting my certain case I'd be very pleased to get it and to reuse...

Thank you.

--
Shamil

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list