0

I upload a file , after upload base on info i got , i resize image , crop and resize it again

but just first resize work , crop and second resize do noting on image, after first resize what i must to do ?

  WebImage img = new WebImage(file.InputStream);
  img.Resize(image_sw, image_sh);

  img.Crop(image_y, image_x, image_y + image_h, image_x + image_w);

  img.Resize(300, 300);

  var path = Request.MapPath("~/Content/images/category/" + model.ID + "." + type);
  img.Save(path);
4

1 回答 1

1

Resize方法有一个带有新调整大小的图像的返回参数。只需保存 img 就会以旧尺寸保存旧图像。

尝试这个:

img = img.Resize(300, 300);
于 2015-04-29T13:01:18.847 回答