【发布时间】:2011-03-08 20:08:43
【问题描述】:
我想在服务器端裁剪图像(我使用的是“JCrop”和“ASP.NET 3.5”)。 有一种情况,用户可以将外部站点的图像添加到文章中。我想要 使用户能够从该图像创建缩略图并将结果存储在服务器上。 在这种情况下,代码类似于
string originalFile = Server.MapPath(this.srcImage.ImageUrl);
using (Image img = Image.FromFile(originalFile))
{
using (System.Drawing.Bitmap _bitmap = new System.Drawing.Bitmap(w, h))
{
_bitmap.SetResolution(img.HorizontalResolution, img.VerticalResolution);
......
[Please see code here][1] will not work as the image URL is external and not a file on the server's file system.
谁能告诉我如何从给定的外部图像 URL 字符串创建 System.Drawing.Image 对象
【问题讨论】:
标签: asp.net image url image-manipulation