How to resize images before upload using C # asp.net

1

I am learning .net mvc 4 and I would like to know if there are any good and simple libraries, to resize images before uploading, I researched google and only found complex functions with resizing calculations done in the hand. Since this is a very common thing, I believe there is some library ready and functional for this task. Anyone know of any?

    
asked by anonymous 11.06.2015 / 19:16

2 answers

1

I found that the System.Web.Helpers library has a class named WebImage ". Here you can resize the image and save the upload. I just needed a logic to find the correct height, because it does not allow only width or height as a parameter, so the code looks like this:

int width = 800;
int height = (int)Math.Round(((width * 1.0) / image.Width) * image.Height);
image.Resize(width, height);
image.Save(path + fileName);

Source: link

    
12.06.2015 / 03:40
0

I believe this can solve:

link

and a component that resizes images:

link

    
11.06.2015 / 20:13