$("#container").wPaint([options]);
A little jQuery plugin paint app that allows you to draw an image using some basic tools providing ability to load and save the images drawn. This is based on HTML5 canvas and will require a browser with support for canvas to run.$("#container").wPaint([options]); |
Set or get any of the options. var wp = $("#container").wPaint([options]); var mode = wp.wPaint("mode"); wp.wPaint("mode", "Ellipse"); |
Specify the default mode that paint app will start in. $("#container").wPaint({mode: "Rectangle"}); default: "Pencil" values: "Rectangle", "Ellipse", "Line", "Pencil", "Eraser" |
|
Set the minimum line width that can be set. $("#container").wPaint({lineWidthMin: 0}); default: 0 values: <integer> |
|
Set the maximum line width that can be set. $("#container").wPaint({lineWidthMax: 20}); default: 10 values: <integer> |
|
Set the default line width. $("#container").wPaint(lineWidth: 10); default: 2 values: <integer> |
|
Set the default color to use for fill style. $("#container").wPaint(fillStyle: "#336699"); default: "#FFFFFF" values: <hex color> |
|
Set the default color to use for stroke style. $("#container").wPaint(strokeStyle: "#446688"); default: "#FFFF00" values: <hex color> |
|
Set the initial base64 encoded image to load into the canvas. $("#container").wPaint({image: "data:image/png;base64,<image data>"}); default: null values: data:image/png;base64,<image data> |
|
Function to execute when drawing event begins. $("#container").wPaint({drawDown: function(e, element){}}); default: null values: function(e, element){} |
|
Function to execute during drawing. $("#container").wPaint({drawMove: function(e, element){}}); default: null values: function(e, element){} |
|
Funciton to execute when drawing event completes. $("#container").wPaint({drawUp: function(e, element){}}); default: null values: function(e, element){} |