2012-12-29 106 views
0

下面是我的代码上传和图像,并将其保存稍后显示在GridView,ASP.NET保存前调整图像大小?

我如何保存它,如果它过大之前调整图像到一个小的?

if (this.fuUpload.HasFile == true) 
     { 
      string path = Server.MapPath(@"~\images"); 
      string filename = this.fuUpload.FileName; 
      this.fuUpload.SaveAs(path + @"\" + filename); 
      this.image.ImageUrl = @"\images\" + filename; 
     } 
+1

谷歌为“.net调整大小的图像”。有很多的例子,比如这里的SO:http://stackoverflow.com/questions/703873/how-to-proportional-resize-image-of-any-type-in​​-net –

回答