triceam / html5-canvas-brush-sketch Goto Github PK
View Code? Open in Web Editor NEWSample sketch app using HTML5 Canvas that demonstrates lineTo drawing techniques, as well as brush images.
Home Page: http://www.tricedesigns.com/?p=1212
Sample sketch app using HTML5 Canvas that demonstrates lineTo drawing techniques, as well as brush images.
Home Page: http://www.tricedesigns.com/?p=1212
Sample application demonstrating a drawing application/sketch techniques for HTML5 Canvas elements. You can read full details how this works at: http://www.tricedesigns.com/2012/01/04/sketching-with-html5-canvas-and-brush-images *lineTo(x,y)********************************************************* The first technique uses the canvas's drawing context moveTo(x,y) and lineTo(x,y) to draw line segments that correspond to the mouse/touch coordinates. Think of this as playing "connect the dots" and drawing a solid line between two points. *brush images******************************************************** The technique for using brush images is identical in concept to the previous example - you are drawing a line from point A to point B. However, rather than using the built-in drawing APIs you are programmatically repeating an image (the brush) from point A to point B. ********************************************************************* Both the lineTo.html and brush.html apps use the exact same code, which just uses a separate rendering function based upon the use case. Feel free to try out the apps on your own using an iPad or in a HTML5 Canvas-capable browser: lineTo sketch: http://tricedesigns.com/portfolio/sketch/lineTo.html brush sketch: http://tricedesigns.com/portfolio/sketch/brush.html ********************************************************************* This sample uses jQuery and Modernizr libraries
First off, thanks for making such nice code available :)
I'd like to use your code, but in your js files no license information is mentioned (or even in the readme). I see you intended it to have a MIT license though by a comment you made on your blog http://www.tricedesigns.com/2012/01/04/sketching-with-html5-canvas-and-brush-images/
(There is license information in the js libraries that you used, but I'm talking about the js files you wrote.)
Isaac
Thanks for the beautiful application. Is it possible to color the drawn image using brush technique ? I see no possibility than using different image for different colors.
Event 'touchmove' need stopPropagation. Add to callback "mouseDownEvent" return false
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.