up: programming - HTML  
programming - HTML5 - canvasWhat links here?
include a canvas in a webpage:
<canvas id="a_canvas" width="300" height="225">


obtain a reference to the canvas to use with javascript:
var a_canvas = document.getElementById("a_canvas");
var a_context = a_canvas.getContext("2d");


draw a rectangle:
a_context.fillRect(x, y, width, height);


Canvas context properties
stylefillStyleset or return the color, gradient, or pattern used to fill the drawing
stylestrokestyleset or return the color, gradient, or pattern used to draw lines
colorshadowColorset or return the color used for shadows
colorshadowBlurset or return the level used for shadow blurring
colorshadowOffsetXset or return the offset of the shadow from the object
colorshadowOffsetY


Canvas context Methods
createLinearGradient()
createPattern()
createRadialGradient()
addColorStop()



Resources
WWW Schools - HTML Canvas Reference
MDN - HTMLCanvasElement
Dive Into HTML5 #4 Let's call it a drawing surface
programming - HTML5 - canvas
AutoCAD LISP - TBLNEXT
programming - javascript - objects - window
bible - random notes - 2012-04-23 Hallelujah
filename:programming - HTML5 - canvas
filename:programming%20%2D%20HTML5%20%2D%20canvas
last edit:October 23 2015 17:06:23 (3407 days ago)
ct = 1740080466.000000 = February 20 2025 14:41:06
ft = 1445634383.000000 = October 23 2015 17:06:23
dt = 294446083.000000