I'm guessing JCrop is designed to work with <img>
not <canvas>
, but maybe this will be helpful: Cropping image drawn into canvas with JCrop
In Papaya, take a look at these in viewer.js:
papaya.viewer.Viewer.prototype.mouseDownEvent
papaya.viewer.Viewer.prototype.mouseMoveEvent (see isDragging)
papaya.viewer.Viewer.prototype.mouseUpEvent
// these might be useful to set a command-key to enable your feature
papaya.viewer.Viewer.prototype.keyDownEvent
papaya.viewer.Viewer.prototype.keyUpEvent
Note, there are already several features that listen to mouse moving and dragging, so you'd have to work around those (maybe add a new command-key for your action) or disable the existing behavior.