Click to See Complete Forum and Search --> : croping images with javascript
batmitra
01-07-2003, 11:20 AM
hi
i'm new here and need help
i'm a begginner on web development and 'm developing a photo site in wich i'd like to let users sugest a croping to an image, i know its possible because i saw it at http://www.photoblink.com.
so the thing is:
1-i have an image (jpg)
2. i want to pick up that image and put it on the background
3. i want to be able to crop the image but keeping the original image below
4-i want to be able to save the croped image with another name
thanks
BestZest
01-07-2003, 11:53 AM
You CAN crop an image in JavaScript, but you CAN'T save ANYTHING! ok.
To crop an image use
//clipTop-clipRight-clipBottom-clipLeft
document.getElementById("pic").clip="rect("0 200 200 0)"
This clips an image to 200 pixels tall, and 200 pixels wide.
Now I havn't got the time or patence to write out a full dynamic solution, get a book. I may come back later, depends.
BestZest
batmitra
01-08-2003, 04:19 AM
thanks bestzest
i'm sorry for taking your time
what you've shown me is very good but that i can do with asp.net wich is the language i'm working on what i can't figure out how to do is while having an image out square or othwer symbol on the edges of that image to alow the user to click on those symbols and resize the image in real time,all this keeping the original image below the changed one
but thanks anyway if yo want to help me more i'm greatful
AdamGundry
01-08-2003, 10:59 AM
I don't know ASP, but you should be able to write a page which dynamically generates an image and displays it along with the original. You could use hyperlinked symbols (images) to let the user change the cropping (passing the change using GET parameters). That way the user just gets pure HTML, so it works on non-Javascript browsers and they can save the cropped image by right-clicking it.
Adam
BestZest
01-08-2003, 01:25 PM
me again with a full script! :D
visit this page (http://www30.brinkster.com/bestzest/js/cropimage.html) on my site, www.kzstudios.vze.com
Hope this helps!
BestZest
batmitra
01-08-2003, 05:49 PM
thanks bestzest you've just what i needed now i can pass the final y and x pos to asp?
if i can do that i can save the image get it?:D
Prominenter
02-17-2003, 03:41 PM
@BestZest
is great !!!!!
Thx.