调整文件夹中的图像大小并显示在控件中而不保存到任何文件夹。 [英] Resize the images from the folder and show in the control without saving to any folder.

查看:99
本文介绍了调整文件夹中的图像大小并显示在控件中而不保存到任何文件夹。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在c#中有一个Web应用程序。它有一个图像文件夹。我希望动态调整这些图像的大小取决于请求。(有时它是180 * 180或566 * 566等)并显示在img控件中无需保存在任何地方。仅供显示。



谢谢

Hi,

I have an web application in c#.It is having an image folder. I want to re size those images dynamically depends up on the request.(some times it is 180* 180 or 566 * 566 etc) and show in a "img" control no need to save anywhere.Only for display .

Thank You

推荐答案

我假设您这样做是为了显示缩略图或类似内容?

如果是这样,那么就个人而言,我会创建一个名为缩略图的文件夹,并将缩略图保存到该文件夹​​中,将拇指交叉引用到完整图像 - 这样您只需执行一次。



但是......无论哪种方式,Image类都有一个 GetThumbnailImage方法 [ ^ ]就是这样 - 在不使用中间文件的情况下从完整图像创建缩略图图像。
I assume you are doing this to show a thumbnail or similar?
If so, then personally, I'd create a folder called "thumbnails" and save a thumbn to that, cross referencing the thumb to the full image - that way you only do it once.

But...either way, the Image class has a GetThumbnailImage method[^] which does exactly that - creates a thumbnail image from a full image without using an intermediary file.


这篇关于调整文件夹中的图像大小并显示在控件中而不保存到任何文件夹。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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