ASP.NET格式的图像以缩略图形式显示 [英] IMAGES IN ASP.NET GRIDVIEW IN THUMBNAIL FORMAT

查看:70
本文介绍了ASP.NET格式的图像以缩略图形式显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想以缩略图形式显示数据库格式中的图像,

当我点击它时THUMBNAIL IMAGE我希望在一个新的窗口中显示完整的图像。

如何做到这一点。

HI ,

I WANT TO SHOW IMAGES PRESENT IN DATABASE GRID VIEW CONTROL IN THUMBNAIL FORMAT,
AND WHEN I CLICK ON THAT THUMBNAIL IMAGE I WANT TO SHOW FULL IMAGE IN A NEW WINDOW.
HOW TO DO THIS.

推荐答案

有两组图像:原始完整大小并重新采样到缩略图大小。将它们作为文件保存在服务器端。创建一个函数,该函数通过另一个集合中的文件名在一个集合中查找文件名。实现它的一种最简单的方法是使用特殊的命名方案:比如,MyFile.png(完整大小)可以有它的缩略图对应名称,比如说MyFile.thumbnail.png,所以该函数只是添加或删除.thumbnail后缀。点击后,找到缩略图文件名,计算出它的全尺寸文件名,按照你想要的方式显示。



这个是最简单的方法之一。你可以设计更复杂的东西,特别是如果你希望你的作品在功能上增长或者出于任何原因需要额外的灵活性。



任何进一步的问题?怎么展示?还有什么吗?



-SA
Have two sets of the images: of original full size and resampled down to a thumbnail size. Keep them on your server side as files. Create a function which finds a file name in one set by a file name in another set. One simplest way to implement it would be using special naming schema: say, "MyFile.png" (full size) could have its thumbnail counterpart names, say ""MyFile.thumbnail.png", so the function will be just adding or removing ".thumbnail" suffix. On click, locate the thumbnail file name, calculate the full-size file name out of it, show it the way you want.

This is one of the simplest ways. You can design something more sophisticated, especially if you expect your work to grow in features or need extra flexibility by whatever reason.

Any further questions? How to show? Anything else?

—SA


< code>< code><>&< a href = >< / a> pre lang =c ++>
<code><code><>&<a href=""></a>pre lang="c++">
<pre lang="c++"><pre lang="c++">

strike>

strike>


这篇关于ASP.NET格式的图像以缩略图形式显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆