2012-12-29 136 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 –

回答