I’m using this in my app:
http://www.html5canvastutorials.com/labs/html5-canvas-drag-and-drop-resize-and-invert-images/
have use anchors for resizing the image ..
What I want is to resize the image and keep its ratio maintained.
I don’t want it to stretch
I’m able to achieve that using this peace of code.:..
if(width) {
image.setSize(width);
}
But this is screwing up the anchors ..
Anyone ever tried something like this..
I know this is a horribly old post but I needed to implement this exact thing and found the accepted answer is quite flawed – the left two drag handles move the entire image and act very much unlike an image editing program would, for instance. I am posting my solution in case someone stumbles upon this from a Google search like I did.
Modified KineticJS example in JSBin: http://jsbin.com/iyimuy/1/edit