ImageResizer 是开源的项目,实现了以 QueryString (n1=v1&n1=v1)传参以控制图片尺寸、质量等。
示例:
using ImageResizer; //Converts a jpeg into a png ImageBuilder.Current.Build("~/images/photo.jpg","~/images/photo.png", new ResizeSettings("format=png"));//源地址 目的地址 转换参数 //Crops to a square (in place) ImageBuilder.Current.Build("~/images/photo.jpg","~/images/photo.jpg", new ResizeSettings("width=100&height=200&crop=auto"));