MVC3/Razor 缩略图/调整图像大小的想法? [英] MVC3/Razor thumbnail/resize image ideas?

查看:36
本文介绍了MVC3/Razor 缩略图/调整图像大小的想法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MVC3/Razor 中是否有一种简单且动态的方法来创建缩略图和调整图像大小?帮手,图书馆,什么?

Is there an easy and dynamic way to create thumbnails and resize images in MVC3/Razor? A helper, libary, anything?

如果我能以某种方式从控制器管理图像的大小,那就太好了.甚至在剃刀视图中.示例:在索引视图中,我希望图像具有特定大小,但在详细信息视图中,我希望它们是完整大小.

It would be nice, if I somehow could manage the size of the images from the controller. Or even in razorview. Example: In the index view I want the images to be a certain size, but in the details view i want them to be full size.

我知道这个问题很模糊,但除了旧的 mvc1 thingos 之外,我真的在 google/stackoverflow 上找不到任何东西.

I know this question is vague, but I really couldnt find anything on google/stackoverflow other than old mvc1 thingos.

你们通常如何处理这个问题?

How do you guys normally deal with this?

推荐答案

另请查看我的 Simple.ImageResizer.MvcExtensions nuget 包.

Also take a look at my Simple.ImageResizer.MvcExtensions nuget package.

此处的演示站点:http://imageresizer.apphb.com/

添加一个 ImageResult 类,您可以在控制器操作中使用该类,该类接受高度和宽度输入,从而可以非常轻松地将图像调整大小添加到您的 mvc 站点.很想听听你的想法

Adds a ImageResult class that you can use in your controller action that takes a height and width input making it pretty easy to add image resizing to your mvc site. Would love to hear what you think

这篇关于MVC3/Razor 缩略图/调整图像大小的想法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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