Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Html5 Canvas Cheat Sheet

Html5 Canvas Cheat Sheet

Ratings: (0)|Views: 2 |Likes:
Published by nationalaudubon

More info:

Published by: nationalaudubon on Oct 18, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/16/2014

pdf

text

original

 
http://blog.nihilogic.dk/
Canvas element
Attributes
Name Type Default
width
 
unsigned long
300
height
 
unsigned long
150
Methods
Return Name
string
 
toDataURL(
[Optional]
string
 
type
,[Variadic]
any 
 
args)
Object
 
getContext(
 
string
 
contextId)
2D Context
Attributes
Name Type 
canvas
 
HTMLCanvasObject
[readonly]
Methods
Return Name
void 
 
save(
 
)
void 
 
restore(
 
)
Transformation
Methods
Return Name
void 
 
scale(
 
 float
 
x
,
 float
 
y)
void 
 
rotate(
 
 float
 
angle)
void 
 
translate(
 
 float
 
x
,
 float
 
y)
void 
 
transform(
 float
 
m11
,
 float
 
m12
,
 float
 
m21
,
 float
 
m22
,
 float
 
dx
,
 float
 
dy)
void 
 
setTransform(
 float
 
m11
,
 float
 
m12
,
 float
 
m21
,
 float
 
m22
,
 float
 
dx
,
 float
 
dy)
Image drawing
Methods
Return Name
void 
 
drawImage(
Object
 
image
,
 float
 
dx
,
 float
 
dy
,[Optional]
 float
 
dw
,
 float
 
dh)
Argument "image" can be of type
HTMLImageElement
,
HTMLCanvasElement
or
HTMLVideoElementvoid 
 
drawImage(
Object
image,
 float
 
sx
,
 float
 
sy
,
 float
 
sw
,
 float
 
sh
,
 float
 
dx
,
 float
 
dy
,
 float
 
dw
,
 float
 
dh)
Compositing
Attributes
Name Type Default
globalAlpha
 
 float
1.0
globalCompositeOperation
string
 source-overSupports any of the following values:source-over source-in source-outsource-atop destination-over destination-indestination-out destination-atop lightercopy xor
Line styles
Attributes
Name Type Default
lineWidth
 
 float
1.0
lineCap
 
string
buttSupports any of the following values:buttroundsquare
lineJoin
 
string
miterSupports any of the following values:roundbevelmiter
miterLimit
 
 float
10
HTML5 Canvas Cheat Sheet
v1.1

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->