Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ultimate Image Manipulation

Status
Not open for further replies.

iaresean

Programmer
Mar 24, 2003
570
ZA
Hi All;

I am trying to build myself the perfect Image manipulation script based on my re-occurring requirements within my company. I have incorporated a few good image scripts (Including the free BetterImageProcessor).

The last requirement I would like to satisfy for my script is this:
I currently allow the user to specify image resize max width and height and also whether they would like to keep the aspect. If they decide not to keep the aspect I would like to give them the option of selecting which portion of the image should be cut off (for example, they uploading a rectangular image that needs to be resized into a square thumb). I would love for them to be able to specify something like: cut image from right/left/top/bottom/center.

Does anybody here use a script, or know of one, that does such image manipulation? Preferably a free solution. :)

I will be super happy with any links/example-code.

Sean. [peace]
 
You should be able to do this fairly easily with the GDI+ library. I imagine the steps will involve loading the original image with the Graphics.FromImage method and then using the DrawImage method to write out the cropped image. As the DrawImage method can accept co-ordinates, you would just pass in the values of where you want to crop from and to (i.e. top-left and bottom-right).




____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top