user3892518
user3892518

Reputation: 65

WebImage Crop After Resize dont work

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);

Upvotes: 0

Views: 514

Answers (1)

Arcturus
Arcturus

Reputation: 27065

The Resize method has a return argument with the new resized image. Just saving the img will save the old image in the old sizes.

Try this:

img = img.Resize(300, 300);

Upvotes: 1

Related Questions