All drawing on the canvas must be done inside JavaScript :-
Example-
Example-
- <HTML>
- <body>
- <canvas id="canvas-ex" width="300" height="200" style="border:2px solid #A5A5A5;">
- THE CANVAS TAG
- </canvas>
- <script>
- var i=document.getElementById("canvas-ex");
- var ctx=i.getContext("2D");
- ctx.fillStyle="#FF2200";
- ctx.fillRect(0,0,180,90);
- </script>
- </body>
- </HTML>
No comments:
Post a Comment