All Projects → jimdoescode → jqScribble

jimdoescode / jqScribble

Licence: other
A touch enabled jquery plugin for drawing on a canvas

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to jqScribble

international-telephone-input
Integration to Magento 2 a jQuery plugin for entering and validating international telephone numbers.
Stars: ✭ 26 (-63.89%)
Mutual labels:  jquery-plugin
react-fastclick
A react component that triggers click events for taps (short localized touches)
Stars: ✭ 20 (-72.22%)
Mutual labels:  touch
jquery-datepicker
A full-featured datepicker jquery plugin
Stars: ✭ 35 (-51.39%)
Mutual labels:  jquery-plugin
jquery-smarty
jQuery Smarty Plugin (jQSmarty) is a port of the Smarty Templating Engine to Javascript/jQuery, offering a familiar client-side templating solution
Stars: ✭ 18 (-75%)
Mutual labels:  jquery-plugin
android-3d-model-viewer
Android app to load 3D models in obj, stl, dae & gltf format using pure OpenGL ES 2.0. Published on Play Store https://play.google.com/store/apps/details?id=org.andresoviedo.dddmodel2
Stars: ✭ 150 (+108.33%)
Mutual labels:  touch
jquery-lightbox
A jQuery plugin, inspired and based on Lightbox 2 by Lokesh Dhakar
Stars: ✭ 22 (-69.44%)
Mutual labels:  jquery-plugin
jquery.peekABar
jQuery plugin for a Notification Bar
Stars: ✭ 59 (-18.06%)
Mutual labels:  jquery-plugin
jquery-transfer
☑️ A jQuery plugin that is a shuttle box
Stars: ✭ 41 (-43.06%)
Mutual labels:  jquery-plugin
scrollbox
A lightweight jQuery custom scrollbar plugin, that triggers event when reached the defined point.
Stars: ✭ 15 (-79.17%)
Mutual labels:  jquery-plugin
jquery-linechart
JQuery plugin for creating charts
Stars: ✭ 42 (-41.67%)
Mutual labels:  jquery-plugin
stm32 i2c to usb hid multitouch
i2c to usb hid multi touch with stm32
Stars: ✭ 55 (-23.61%)
Mutual labels:  touch
emulatetab
A jQuery plugin to emulate tabbing between elements on a page.
Stars: ✭ 15 (-79.17%)
Mutual labels:  jquery-plugin
jquery-digitalwrite
jquery plugin to write charecters in digital format in a 5x5 matrix
Stars: ✭ 24 (-66.67%)
Mutual labels:  jquery-plugin
animationCounter.js
animationCounter.js is a jQuery plugin that animates a number from a value to another value or to an infinite value
Stars: ✭ 18 (-75%)
Mutual labels:  jquery-plugin
gestures
A library for normalized events and gesture for desktop and mobile.
Stars: ✭ 31 (-56.94%)
Mutual labels:  touch
react-pressure
React HOC that enables 3D Touch on other components, available via npm
Stars: ✭ 13 (-81.94%)
Mutual labels:  touch
NoobScroll
A lightweight jQuery Plugin that add some cool function to make scrolling more fun [Archive]
Stars: ✭ 43 (-40.28%)
Mutual labels:  jquery-plugin
jquery-slidePanel
A jquery plugin that show a slide panel on side.
Stars: ✭ 46 (-36.11%)
Mutual labels:  jquery-plugin
jQuery-Freeze-Table-Column-and-Rows
This is a jQuery plugin that can make table rows and columns not scroll. It can take a given HTML table object and set it so it can freeze a given number of columns or rows or both, so the fixed columns or rows do not scroll. The rows to be frozen should be placed in the table head section. It can also freeze rows and columns combined with using…
Stars: ✭ 20 (-72.22%)
Mutual labels:  jquery-plugin
fancy-textfill
Fast implementation for resizing text to fill its container.
Stars: ✭ 17 (-76.39%)
Mutual labels:  jquery-plugin

jqScribble

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.

Usage

To use the jqScribble plugin first select a jquery element to attach to scribble canvas to. Then specify any options you wish.

$('#test').jqScribble(options);

Available Options

  • width (int) The width of the Canvas element if not specified then the width of the parent is used
    • DEFAULT - 300
  • height (int) The height of the Canvas element if not specified then the height of the parent is used.
    • DEFAULT - 250
  • backgroundImage (string) An image to add to the background of the canvas.
    • DEFAULT - false
  • backgroundImageX (int) The X offset in the canvas to put the specified background image
    • DEFAULT - 0
  • backgroundImageY (int) The Y offset in the canvas to put the specified background image
    • DEFAULT - 0
  • backgroundColor (string) The hex color value to set the background as.
    • DEFAULT - #ffffff
  • saveMimeType (string) If the image is saved the mime type that will be used.
    • DEFAULT - image/png
  • saveFunction (function) The function to use when saving the drawing.
    • DEFAULT - BasicCanvasSave
  • brush (jqScribbleBrush) The brush to used when drawing on the Canvas.
    • DEFAULT - BasicBrush
  • brushSize (int) The size of the brush that is used.
    • DEFAULT - 2
  • brushColor (string) The color of the brush stroke.
    • DEFAULT - #000
  • fillOnClear (bool) Controls whether or not the canvas will be filled with color upon execution of clear().
    • DEFAULT - true

Exposed Attributes

You can access the canvas DOM element of a jqScribble instance by calling

$('...').data('jqScribble').canvas

You can check if the jqScribble instance has been drawn on by checking

$('...').data('jqScribble').blank

To get the brush object that jqScribble is currently using

$('...').data('jqScribble').brush

Creating New Brushes

New brushes should inherit from the jqScribbleBrush object as follows:

NewBrush.prototype = new jqScribbleBrush.
NewBrush(){...}

They should also implement the following methods:

strokeBegin(x, y)
strokeMove(x, y)

and can optionally implement

strokeEnd()

Image Saving

A save function will be passed the image data of the canvas, provided the canvas is not empty.

function mySave(imageData)

The specified save function will not be called until the canvas is not empty and you call the jqScribble save function.

$('...').data('jqScribble').save()

You can also specify a save function at the time of saving by calling save with a function parameter.

$('...').data('jqScribble').save(function(imageData){...});

The save method is chainable with other jqScribble methods.

Updating jqScribble Options

Updates can be passed to the jqScribble instance by calling

$('...').data('jqScribble').update(options)

Where options are any of the original options specified above. The update method is chainable with other jqScribble methods.

Clearing The Canvas

To reset the canvas call

$('...').data('jqScribble').clear()

The clear method is chainable with other jqScribble methods.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].