Draw! jQuery drawing plugin.

联合创作 · 2023-10-02 14:12

This plugin was created after noticing Walter Zorn's javascript for drawing shapes on screen with div's.

I've also looked into the drawlibrary plugin, but it has a little too much overhead. Drawlibrary does use the same algorithms as Walter Zorns work as well, but relies on svg files when using Microsoft I.E. This plugin does not.

Here is some example code:

$("#myCanvas").drawRect(10, 10, 20, 20, {color:'blue', alpha: .5});
$("#myCanvas").drawPolygon([100, 100, 90, 30], [20, 30, 40, 60], {color:'#00FF00', alpha: .9});
$("#myCanvas").drawEllipse(100, 200, 40, 40, {color:'orange', stroke: 10});
$("#myCanvas").fillArc(50, 200, 40, 40, 90.0, 180.0, {color:'#336699', alpha: .2});
$("#myCanvas").fillPolygon([150, 300, 90, 30], [20, 30, 40, 60], {color:'yellow', alpha: 1});

My canvas is an empty div tag with id="myCanvas"

浏览 7
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报