最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - javascript library for free form drawing - Stack Overflow

programmeradmin2浏览0评论

Is there a javascript library which lets me draw on a web page and then save the state of that drawing?

I want to draw an 2D image using the mouse and then how to store and load that drawing

Is there a javascript library which lets me draw on a web page and then save the state of that drawing?

I want to draw an 2D image using the mouse and then how to store and load that drawing

Share Improve this question asked Jul 21, 2011 at 3:16 ed1ted1t 8,68917 gold badges70 silver badges111 bronze badges 1
  • Related: How do I hand draw on canvas? – Martin Thoma Commented Oct 8, 2014 at 12:26
Add a comment  | 

3 Answers 3

Reset to default 10

Use HTML5 Canvas. A simple example for drawing images is here: http://jsfiddle.net/ghostoy/wTmFE/1/.

I recommend this online book: Dive Into HTML5.

You should look at ProcessingJS.

If you want the free drawing to work with touchscreens, I recommend Fabric.js:

  • Demo
  • Tutorial

Code:

<canvas id="c1" width="100" height="100" style="border:1px solid black;">
</canvas>

var canvas = new fabric.Canvas('c1');
canvas.isDrawingMode = true;
canvas.freeDrawingBrush.width = 5;
console.log(canvas);

See JSfiddle

发布评论

评论列表(0)

  1. 暂无评论