|
<html>
| <body>
| <body onload="go()">
| <canvas id="canvas" width="24" height="24"></canvas>
| <script>
|
| function go() {
| var canvas = document.getElementById("canvas");
| var ctx = canvas.getContext("2d");
|
| var points = [];
| points[0] = [0, 2];
| points[1] = [0, 1];
| points[2] = [1, 0];
| points[3] = [2, 0];
| points[4] = [3, 23.5];
| points[5] = [23, 24];
| points[6] = [24, 24];
| points[7] = [4, 23.5];
| points[8] = [3, 0];
| points[9] = [2, 0];
| points[10] = [1, 1];
| points[11] = [1, 2];
|
| for(var i=0;i<12;i++) {
| points[i][1] = points[i][1] * 1e-30;
| }
|
| for(var i=0;i<12;i++) {
| points[i][1] = points[i][1] + points[i][0] * 1e-28;
| }
|
| var path = new Path2D();
| path.moveTo(points[0][0], points[0][1]);
| for(var i=1; i<12; i++) {
| path.lineTo(points[i][0], points[i][1]);
| }
| path.closePath();
|
| ctx.setTransform(1, -100, 0, 1e+30, 0, 0);
| ctx.fill(path);
| }
|
| </script>
| </body>
|
|