Chapter 3
Vector Graphics with canvas
Once upon a time, if you wanted to create graphics on the fly on the Web, you had three choices:
-
Use server-side generation.
-
Use Flash.
-
Use Java.
Server-side generation works fairly well when you’re producing images for static data (stuff that won’t change once the page has loaded, like CAPTCHA images). However, the processing time needed to generate a server-side image, and the fact that the image has to be transferred between the server and the client, mean that you can’t use the server to create graphics that change in real time. This precludes the use of server-side generation in situations where we want the image to respond dynamically to user input, like mouse movements or keystrokes. ...
Get The Art & Science of JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.