I can show rectangle part of image using clip-rect attribute in raphael.js.
Could you please tell me how I can rotate that clip-rect area (not the image). Maybe I should use clipPath svg attr? But it has to be raphael.js solution, so that IE's vml would do this as well?
You can do something like this:
r = Raphael('myid',600,400);
myimage = r.image('http://25.media.tumblr.com/032e7b64fbc53862cb4c53b6a564f216/tumblr_mnthd5m5y21sqq5odo3_1280.jpg',0,0,600,400)
myimage.attr({'clip-rect':[100,100,200,200]})
myrect = r.rect(100,100,200,200).transform("r45")
myimage.clip.setAttribute("transform", myrect.node.getAttribute("transform"))
See in fiddle: http://jsfiddle.net/arpitworld/ME2Gr/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With