【问题标题】:clip-rect area rotation raphael.js剪辑矩形区域旋转 raphael.js
【发布时间】:2011-08-04 15:18:20
【问题描述】:

我可以使用 raphael.js 中的 clip-rect 属性显示图像的矩形部分。

能否请您告诉我如何旋转该剪辑矩形区域(不是图像)。也许我应该使用 clipPath svg attr?但它必须是raphael.js的解决方案,这样IE的vml也能做到这一点?

【问题讨论】:

    标签: internet-explorer svg rotation raphael image-clipping


    【解决方案1】:

    你可以这样做:

    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"))
    

    见小提琴:http://jsfiddle.net/arpitworld/ME2Gr/1/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-29
      • 1970-01-01
      • 1970-01-01
      • 2019-05-27
      • 1970-01-01
      • 2015-10-18
      • 2012-10-13
      相关资源
      最近更新 更多