Roger Far
Roger Far

Reputation: 2394

C# image cropper + resizer

I am looking for a simple image resize + cropper. No need for upload functionality, just a handy gui for resizing and cropping.

I found http://i-load.radactive.com/ but that has been discontinued, does anyone have a good alternative?

Upvotes: 0

Views: 2359

Answers (3)

Lilith River
Lilith River

Reputation: 16468

Kon's answer is blissfully ignorant of the 28 pitfalls that most "copy and paste" solutions face. You should use the http://imageresizing.net library. It's been refined for 4 years, and is very stable and mature. And it's free.

Here's how to crop and resize interactively using the library. It's very simple.

If you want to auto-crop and center, just add ?width=x&height=y&crop=auto to the target image URL.

Upvotes: 1

Aristos
Aristos

Reputation: 66649

There are two parts to make this work.

First part is the javascript, you need to make the selection to crop on the browser side. For that I use the jCrop but there are more other.

Ones you get the cordincate from the javascript code, you pass it on post back on the code behind that you make the resize and the crop.

Upvotes: 0

Kon
Kon

Reputation: 27451

You don't need any special library outside of .NET for it. How to do it has been discussed on SO:

Best resize and or crop logic

How to crop an image using C#?

Also, this may help: Image Resizing and Cropping in C#

Upvotes: 0

Related Questions