Book description
The Canvas element is a revolutionary feature of HTML5 that enables powerful graphics for rich Internet applications, and this pocket reference provides the essentials you need to put this element to work. If you have working knowledge of JavaScript, this book will help you create detailed, interactive, and animated graphics -- from charts to animations to video games -- whether you're a web designer or a programmer interested in graphics.
Canvas Pocket Reference provides both a tutorial that covers all of the element's features with plenty of examples and a definitive reference to each of the Canvas-related classes, methods, and properties.
You'll learn how to:
- Draw lines, polygons, and curves
- Apply colors, gradients, patterns, and transparency
- Use transformations to smoothly rotate and resize drawings
- Work with text in a graphic environment
- Apply shadows to create a sense of depth
- Incorporate bitmapped images into vector graphics
- Perform image processing operations in JavaScript
Table of contents
- Canvas Pocket Reference
- A Note Regarding Supplemental Files
- Preface
-
1. Canvas Tutorial
- Drawing Lines and Filling Polygons
- Graphics Attributes
- Canvas Dimensions and Coordinates
- Coordinate System Transforms
- Drawing and Filling Curves
- Rectangles
- Colors, Transparency, Gradients, and Patterns
- Line-Drawing Attributes
- Text
- Clipping
- Shadows
- Images
- Compositing
- Pixel Manipulation
- Hit Detection
- Canvas Example: Sparklines
-
2. Canvas Reference
- Canvas
- Canvas.getContext()
- Canvas.toDataURL()
- CanvasGradient
- CanvasGradient.addColorStop()
- CanvasPattern
- CanvasPixelArray
- CRC
- CRC.arc()
- CRC.arcTo()
- CRC.beginPath()
- CRC.bezierCurveTo()
- CRC.clearRect()
- CRC.clip()
- CRC.closePath()
- CRC.createImageData()
- CRC.createLinearGradient()
- CRC.createPattern()
- CRC.createRadialGradient()
- CRC.drawImage()
- CRC.fill()
- CRC.fillRect()
- CRC.fillText()
- CRC.getImageData()
- CRC.globalCompositeOperation
- CRC.isPointInPath()
- CRC.lineCap
- CRC.lineJoin
- CRC.lineTo()
- CRC.measureText()
- CRC.miterLimit
- CRC.moveTo()
- CRC.putImageData()
- CRC.quadraticCurveTo()
- CRC.rect()
- CRC.restore()
- CRC.rotate()
- CRC.save()
- CRC.scale()
- CRC.setTransform()
- CRC.stroke()
- CRC.strokeRect()
- CRC.strokeText()
- CRC.transform()
- CRC.translate()
- ImageData
- TextMetrics
- Index
- About the Author
- Copyright
Product information
- Title: Canvas Pocket Reference
- Author(s):
- Release date: December 2010
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449302788
You might also like
book
Laws of UX
An understanding of psychology—specifically the psychology behind how users behave and interact with digital interfaces—is perhaps …
audiobook
Fall in Love with the Problem, Not the Solution
Unicorns-companies that reach a valuation of more than $1 billion-are rare. Uri Levine has built two. …
book
100 Things Every Designer Needs to Know About People, 2nd Edition
WE DESIGN TO ELICIT RESPONSES from people. We want them to buy something, read more, or …
book
Learning SQL, 3rd Edition
As data floods into your company, you need to put it to work right away—and SQL …