views:

136

answers:

2

Scenario. I want to identify things in an image by 'drawing' a rectangle round them. E.g. to select a face in a crowd. A sign in a street etc.

How to use the mouse events to a) mousedown to start select area Grow a 'rectangle' to follow the mouse movements. b) mouseup to end selection. Retrieve the xy, xy of the box for use in further processing. I'd like x and y values of the rectangle to be relative to the img element with id value 'image' if that's possible please.

TIA DaveP

+4  A: 

Take a look at JCrop and test whether it fulfills your needs. I think you will find it does.

Pekka
Perfect Pekka. Mixes own logic with jQuery, but the resultis 90%Thanks.
DaveP