background preloader

Let’s Call It a Draw(ing Surface) - Dive Into HTML 5

Let’s Call It a Draw(ing Surface) - Dive Into HTML 5
You are here: Home Dive Into HTML5 Diving In HTML 5 defines the <canvas> element as “a resolution-dependent bitmap canvas which can be used for rendering graphs, game graphics, or other visual images on the fly.” A canvas is a rectangle in your page where you can use JavaScript to draw anything you want. So what does a canvas look like? Invisible canvas The markup looks like this: Let’s add a dotted border so we can see what we’re dealing with. Canvas with border You can have more than one <canvas> element on the same page. Let’s expand that markup to include an id attribute: Now you can easily find that <canvas> element in the DOM. var a_canvas = document.getElementById("a"); Simple Shapes Every canvas starts out blank. Click to draw on this canvas The onclick handler called this function: function draw_b() { var b_canvas = document.getElementById("b"); var b_context = b_canvas.getContext("2d"); b_context.fillRect(50, 25, 150, 100); } And then there’s this Every canvas has a drawing context Paths path .

http://diveintohtml5.info/canvas.html

Zwibbler: A simple drawing program using Javascript and Canvas - Tested under Firefox 3.5.6 and Google Chrome 3.0.195.38 This project extends the technique I created for imprecise line-drawing to create an entire vector graphics application, similar to Inkscape. It is written almost entirely in Javascript, except for a server-side program that renders text. See below if you are interested in the implementation and coding parts. 8 Drawing Exercises That Every Artist Should Practice Wire Drawing Exercise Example from save-janos.net – this example has been placed on a painted acrylic background With this exercise you are not going to be drawing at all. All you need is some wire and a pair of pliers with cutters. My favorite wire for this exercise is tie wire and you can get it almost any hardware store.

HTML 5 canvas - the basics - Opera Developer Community Table of contents Introduction The HTML5 specification includes lots of new features, one of which is the canvas element. HTML5 canvas gives you an easy and powerful way to draw graphics using JavaScript. 30 Must See HTML5 Tutorials HTML5 and CSS3 expanded the possibilities of web design. There are lots of designers and developers who started practicing HTML5 and implementing it in their web designs. In this roundup we have featured 30 useful HTML5 tutorials that will definitely help developers increase their skills.. Making a Beautiful HTML5 Portfolio

SVG vs. Canvas on Trivial Drawing Application Recent popularity on Canvas development and support has made the need for SVG somewhat vague. As SVG is still not widely adopted and Canvas has recently acquired lot of support from developers and browsers, some might question the role of SVG in future web. However, this is not the case and there is a strong need for SVG. Lackadaisy Expressions Boy, I didn't know what I was getting myself into when I started this. I've had requests for some sort of expressions tutorial dating back a while now, so I figured, "Sure! I can explain expression drawing...and it'll be way better than all those tutorials out there that are nothing but charts of generic expressions.

Constant, Synchronized or ThreadLocal for Utility Objects? A subtle mistake I have made previously is to declare certain "utility" objects as constants in my web app without understanding that they are not thread safe. For example, in my current application I need a SimpleDateFormat object to do some work translating String to Date and vice versa. My first thought is to write the following. For a batch job or stand-alone application, this would probably be ok, because only one thread would ever access this object at once. Some Ojbects are not Thread Safe The problem with the above code is that SimpleDateFormat is not thread safe. Build a Neat HTML5 Powered Contact Form In this tutorial, we are going to learn how to create a swanky HTML5 AJAX powered contact form. The form will use some of the new HTML5 input elements and attributes, and will be validated using the browser's built-in form validation. We will use jQuery and Modernizr to help out with the older browsers, and PHP on the server side to validate the input.

CSS3 + Progressive Enhancement = Smart Design Progressive enhancement is a good thing, and CSS3 is even better. Combined, they enable designers to create lighter, cleaner websites faster and easier than ever before.. CSS3 can do some pretty amazing stuff: text shadows, rgba transparency, multiple background images, embedded fonts, and tons more. Creating an HTML 5 canvas painting application - Opera Developer By Mihai Sucan Table of contents Introduction My previous HTML5 canvas tutorial provided you with insight into the numerous use cases for canvas in web applications. In this article we will explore how you can write your own canvas-based painting application. Making a web application that allows users to draw on a canvas requires several important steps: setting up your HTML document with a canvas context (a canvas element with an id), setting up your script to target that canvas context and draw inside it and adding the required mouse event handlers for user interaction and associated logic.

How To Draw - StumbleUpon "How to Draw" is a collection of tutorials that will teach you everything from perspective basics to shading chrome. Never picked up a pencil before? Fear not! From simple line drawings to modern art and easy animations, we've got you covered. All projects come from Instructables.com and contain pictures for each step so you can start your masterpiece today!

Best Practice Software Engineering - Observer The aim of the Observer-Pattern is to define a one-to-many dependency between objects so that when the object on the "one-side" changes state, all its dependents are notified and updated automatically. The Observer/Observable-Pattern is known under many different Names, each flavor is used for a special purpose and has a slightly different form. Most common other names for this pattern are Producer/ConsumerPublish/SubscribeDependents How to Build a Game with HTML5 HTML5 is growing up faster than anyone could have imagined. Powerful and professional solutions are already being developed...even in the gaming world! Today, you'll make your first game using Box2D and HTML5's canvas tag.

40+ Useful HTML5 Examples and Tutorials HTML5 examples can be really good inspiration for anyone starting a new web project, after all it is the future of web page markup and we all need to prepare for it. HTML5 is being developed as the next major revision of HTML (HyperText Markup Language). The major market and Internet leaders are already switching to the HTML 5 platform.

Related: