This presentation has been developed in the context of the Mobile Applications Development course at the Computer Science Department of the University of L’Aquila (Italy).
external plugins, no libraries, etc. no external plugins, no libraries, etc. You can create lines, use images, use text, apply transformations, etc. http://bit.ly/KsKLv1
HTML element It has methods to draw lines, 2D or WebGL available contexts It has methods to draw lines, boxes, circles, and more push state on state stack pop state from the stack and restore it
value to strokeStyle or fillStyle creates a pattern from an image from an image [repeat | repeat-x | repeat-y | no-repeat] Specifies the gradient's position and color
Path Path Path Path, where a path is a list of subpaths path is a list of subpaths Subpaths Subpaths Subpaths Subpaths are one or more points connected by straight or curved lines The rendering context has always a current path http://bit.ly/KsSc5q
Creates a line from the last point to the first point Fills the current path Fills the current path with the selected color Draws the path on the canvas Creates an area in the canvas, and this area is the only visible area in the canvas
without creating a line Creates a line from the last point in the path to the given point (x,y) Creates a quadratic curve Creates a quadratic curve from the current point in the path to the specified point (x,y) Creates a Bezier curve from the current point in the path to the specified point (x,y)
Creates a new imagedata object, containing data from the canvas Draws imagedata onto the canvas (optionally, you can specify which part of the imageData you want to put)
positioning is scaled) rotate the canvas, based on the angle (in radians) move the canvas horizontally and vertically this is not relative to past transforms
the color set by the fillStyle attribute attribute draws text on the canvas, without filling, using the color of the strokeStyle strokeStyle attribute measures the given text string (returns the result in pixels)