Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to display a set of images on the ASP.net page at run time.

The results of my program is a set of images paths.

The number of these images determined at the run time.

I want to display these images on the web page.

Please, can I get any help.

What I have tried:

C#
Dim ms As System.IO.MemoryStream
          ms = New IO.MemoryStream()
          Original_img.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)
          Dim bbb As String
          bbb = Convert.ToBase64String(ms.ToArray())
          Dim hh As New System.Web.UI.HtmlControls.HtmlImage
          hh.Src = "data:image/gif;base64," + bbb
          picdiv.Controls.Clear()
          hh.Width = 150
          hh.Height = 180
          picdiv.Controls.Add(hh)
Posted
Updated 19-Dec-16 2:10am

1 solution

Hi ,

My suggestion is we can use ASHX (Generic Handler ) to create dynamic Image .

We can use PICbox URL as below
HTML
<img src='Handler.ashx?file=img1' />

Please check below example in C#
[ASHX Example]

Thanks
Siva Rm K
 
Share this answer
 
Comments
Member 11768130 20-Dec-16 15:01pm    
Thank you for your answer.
But I can not use this code because the code is not clear and complete.
Please, I want to do in VB.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900