Click to See Complete Forum and Search --> : How to select an area on a picture?


david1661
08-11-2003, 07:46 AM
Hi,

i would like to make a homepage that display a picture, the user can use the cursor to drag a rectangle area above the picture, the script can then get the coordinates of the area selected and only display that area of the picture. Can anyone teach me how to achieve that please?
thx

Khalid Ali
08-11-2003, 08:27 AM
Theoretically this is how you will do it.

capture mouse events.
start storing co-ordinates when mouse is pressedon the image and stop storing co-ordinates when mouse is up.

Thats how you can create a rectangle