html5 canvas

21
HTML5 canvas Patrick H. Lauke / Developer Relations' HTML5 & CSS3 session / Oslo / 23 February 2010 OPENING UP NEW GRAPHICAL POSSIBILITIES

Upload: patrick-lauke

Post on 15-May-2015

3.335 views

Category:

Technology


2 download

DESCRIPTION

Short presentation focussing on HTML5 canvas - how it works, why it matters. Delivered as part of an Opera-internal set of presentations by the Developer Relations team on 23 February 2010 in Oslo

TRANSCRIPT

Page 1: HTML5 canvas

HTML5 canvas

Patrick H. Lauke / Developer Relations' HTML5 & CSS3 session / Oslo / 23 February 2010

OPENING UP NEW GRAPHICAL POSSIBILITIES

Page 2: HTML5 canvas

canvas = “scriptable images”

First implemented by Applefor OS X Dashboard widgets

Now formally part of HTML5

Page 3: HTML5 canvas

<canvas width="…" height="…"></canvas>

Page 4: HTML5 canvas

canvas has standard API methods for drawing

ctx = canvas.getContext("2d");ctx.fillRect(x, y, width, height);ctx.beginPath();ctx.moveTo(x, y);ctx.lineTo(x, y);ctx.bezierCurveTo(x1, y1, x2, y2, c1, c2);

and loads of other exciting functions – if you like maths and stuff

Page 5: HTML5 canvas

canvas mixing things up with external graphics

ctx = canvas.drawImage(…);

Page 6: HTML5 canvas

krazy canvas demos…

Page 7: HTML5 canvas

why canvas is so exciting...

Page 8: HTML5 canvas

bad news: there's no IDE (yet)

Page 9: HTML5 canvas

good news: no need for IDE(if you know what you're doing)

Page 10: HTML5 canvas
Page 11: HTML5 canvas

good news: no plugins

Page 12: HTML5 canvas
Page 13: HTML5 canvas
Page 14: HTML5 canvas
Page 15: HTML5 canvas
Page 16: HTML5 canvas
Page 17: HTML5 canvas

also works in widgets(depending on Widget Manager)

Page 18: HTML5 canvas

will canvas replace Flash?

Page 19: HTML5 canvas

not a question of replacing …

it gives authors options other than Flash(particularly on platforms where Flash is absent)

Page 20: HTML5 canvas

current stumbling blocks:

slow performance – but getting better with faster JavaScript and rendering engines