jqScribble | A touch enabled jquery plugin for drawing on a canvas | Plugin library
kandi X-RAY | jqScribble Summary
kandi X-RAY | jqScribble Summary
jqScribble is a jquery plugin that will allow you to draw on an HTML5 canvas element. It works with standard mouse input and also touch input. It is designed to be extremely extensible, allowing for custom brushes and image saving. I have also provided with this plugin a sample PHP file that will demonstrate turning drawn images into actual images.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jqScribble
jqScribble Key Features
jqScribble Examples and Code Snippets
Community Discussions
Trending Discussions on jqScribble
QUESTION
I am using a jQuery plugin called jqscribble to draw to canvas. I would like to grayscale an icon if nothing is drawn to the canvas. As mentioned in the plugin documentation, I can check this using $('...').data('jqScribble').blank
and I am using it as such:
ANSWER
Answered 2017-Oct-16 at 12:49A better way to check is to monitor clicks/touches to the canvas assuming those are the only means to draw onto the canvas (if external data is drawn you can always tap into those functions as well though).
- If a click or touch is detected, mark canvas "tainted"
- When cleared (or saved or other condition), clear taint flag
This way you won't have to pull data from the canvas at all times which has a huge overhead for some type of checks like for example pulling a data-uri and compare it to one that represents an empty canvas.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jqScribble
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page