I want to draw on an HTML Canvas using a mouse (ex: draw a signature, draw a name,...)
Please help me how can I do? Please give some source code. Thank you
I want to draw on an HTML Canvas using a mouse (ex: draw a signature, draw a name,...)
Please help me how can I do? Please give some source code. Thank you
Here is a working sample.
I think, other examples here are too complicated. This one is simpler and JS only...
Here is my very simple working canvas draw and erase.
https://jsfiddle.net/richardcwc/d2gxjdva/
Alco check this one:
Example:
https://github.com/williammalone/Simple-HTML5-Drawing-App
Documentation:
http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app/
This document includes following codes:-
HTML:
JS:
And another awesome example
http://perfectionkills.com/exploring-canvas-drawing-techniques/
if you have background image for your canvas, you will have to make some tweaks to have it work properly because white erasing trick will hide the background.
here is a gist with the code.
Googled this ("html5 canvas paint program"). Looks like what you need.
http://dev.opera.com/articles/view/html5-canvas-painting/