Html5 cheat sheet
Canvas element
Attributes
Name width height Type unsigned long unsigned long Default 300 150
http://blog.nihilogic.dk/
Compositing
Attributes
Name globalAlphaType float Default 1.0
Methods
Return string Name toDataURL( [Optional] string type, [Variadic] any args) getContext( string contextId)
globalCompositeOperation string source-over Supports anyof the following values:
Object
source-over
source-in
source-out
2D Context
Attributes
Name canvas Type HTMLCanvasObject [readonly] source-atop Name save( ) restore( )destination-out destination-atop lighter destination-over destination-in
Methods
Return void void
Transformation
Methods
Return void void void void Name scale( float x, float y) rotate( float angle)translate( float x, float y) transform( float m11, float m12, float m21, float m22, float dx, float dy) setTransform( float m11, float m12, float m21, float m22, float dx, float dy)
copy
xor
Linestyles
Attributes
Name lineWidth Type float Default 1.0
void
lineCap string butt Supports any of the following values: butt round square
Image drawing
Methods
Return void Name lineJoinstring miter Supports any of the following values: round bevel miter 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)
miterLimit
float
10
Colors, styles and shadowsAttributes
Name strokeStyle fillStyle shadowOffsetX shadowOffsetY shadowBlur shadowColor Type any any float float float string Default black black 0.0 0.0 0.0 transparent black
Text
AttributesName font Type string Default 10px sans-serif
textAlign string start Supports any of the following values: [start, end, left, right, center] textBaseline string alphabetic Supports any of the...
Regístrate para leer el documento completo.