如何在图像框上显示图像? [英] How can I display an image on image box?
本文介绍了如何在图像框上显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在运行时在ASP.net页面上显示一组图像。
我的程序的结果是一组图像路径。
在运行时确定的这些图像的数量。
我想显示这些图像网页。
请,我可以得到任何帮助。
我有什么试过:
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:
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)
推荐答案
我的建议是我们可以使用ASHX(Generic Handler)来创建动态图像。
我们可以使用下面的PICbox URL
Hi ,
My suggestion is we can use ASHX (Generic Handler ) to create dynamic Image .
We can use PICbox URL as below
<img src='Handler.ashx?file=img1' />
请在下面查看C#
中的示例 [ ASHX示例]
谢谢
Siva Rm K
Please check below example in C#
[ASHX Example]
Thanks
Siva Rm K
这篇关于如何在图像框上显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文