Draw on any image inside your desktop or mobile browser.
data-sketchpad-json
attributeYou can try a working example online: DEMO
npm install image-sketchpad --save
# yarn add image-sketchpad
I have included different files for different usages
First include the JS file at the bottom of your html page
<script src="image-sketchpad.min.js"></script>
</body>
</html>
Second initialize the sketchpad and bind it to an image
<img src="..." id="Image" />
<script src="image-sketchpad.min.js"></script>
<script>
var img = document.getElementById('Image');
var sketchpadOptions = {};
var sketchPad = ImageSketchpad(img, sketchpadOptions);
</script>
</body>
</html>
That's it!
Generated using TypeDoc