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 HTMLVideoElement
void 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-over
Supports any of the following values:
source-over source-in source-out
source-atop destination-over destination-in
destination-out destination-atop lighter
copy xor
Line styles
Attributes
Name Type Default
lineWidth float 1.0
lineCap string butt
Supports any of the following values:
butt round square
lineJoin string miter
Supports any of the following values:
round bevel miter
miterLimit float 10
HTML5 Canvas Cheat Sheet v1.1
评论0
最新资源