HTML 5 canvas music symbols examples |
Symbol and code | |
Original flat
![]() |
Canvas rendered flat
|
Download file
Line 2 : "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Line 3 : <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> Line 4 : <head> Line 5 : <title>Mobilefish.com - Flat HTML 5 canvas example</title> Line 6 : Line 7 : <!-- Line 8 : Music symbol flat v. 1.0 Line 9 : Author: Robert Lie Line 10 : www.mobilefish.com Line 11 : Line 12 : This file is public domain. You can use it for any purpose without restriction. Line 13 : I do not guarantee that it is correct, so use it at your own risk. Line 14 : If you use it for something interesting, I'd appreciate hearing about it. Line 15 : If you find any bugs or make any improvements, I'd appreciate hearing about those too. Line 16 : It would also be nice if my name and URL were left in the comments. But none of that is required. Line 17 : Line 18 : Requires: File excanvas.compiled.js Line 19 : HTML5 Canvas for Internet Explorer Line 20 : See: http://code.google.com/p/explorercanvas/ Line 21 : --> Line 22 : Line 23 : <!--[if IE]> Line 24 : <script type="text/javascript" src="scripts/excanvas.compiled.js"></script> Line 25 : <![endif]--> Line 26 : <script type="text/javascript"> Line 27 : Line 28 : Line 29 : function drawShape(){ Line 30 : var canvas = document.getElementById('cssxCoordinates'); Line 31 : if (canvas.getContext){ Line 32 : var ctx = canvas.getContext('2d'); Line 33 : Line 34 : ctx.beginPath(); Line 35 : ctx.moveTo(0,0); Line 36 : ctx.quadraticCurveTo(4,0,9,0); Line 37 : ctx.quadraticCurveTo(9,75,9,155); Line 38 : ctx.quadraticCurveTo(21,139,40,130); Line 39 : ctx.quadraticCurveTo(54,125,64,130); Line 40 : ctx.quadraticCurveTo(76,137,80,147); Line 41 : ctx.quadraticCurveTo(87,164,80,181); Line 42 : ctx.quadraticCurveTo(74,193,64,201); Line 43 : ctx.quadraticCurveTo(35,230,0,259); Line 44 : ctx.quadraticCurveTo(0,150,0,0); Line 45 : ctx.fill(); Line 46 : Line 47 : ctx.fillStyle = "white"; Line 48 : ctx.beginPath(); Line 49 : ctx.moveTo(9,164); Line 50 : ctx.quadraticCurveTo(16,154,25,150); Line 51 : ctx.quadraticCurveTo(37,145,46,149); Line 52 : ctx.quadraticCurveTo(55,156,55,170); Line 53 : ctx.quadraticCurveTo(55,180,51,187); Line 54 : ctx.quadraticCurveTo(47,197,40,206); Line 55 : ctx.quadraticCurveTo(27,225,9,247); Line 56 : ctx.quadraticCurveTo(9,200,9,164); Line 57 : ctx.fill(); Line 58 : Line 59 : } else { Line 60 : alert('You need Firefox 1.5+, Google Chrome 8.0+, Internet Explorer 8.0+ or Safari 4.0+ to see the example.'); Line 61 : } Line 62 : } Line 63 : </script> Line 64 : </head> Line 65 : <body onload="drawShape();"> Line 66 : <h1>Flat</h1> Line 67 : <canvas id="cssxCoordinates" width="104" height="270"></canvas> Line 68 : </body> Line 69 : </html> |