From 2012.igem.org
(Difference between revisions)
|
|
Line 1: |
Line 1: |
- | <!DOCTYPE HTML>
| |
- | <html>
| |
- | <head>
| |
- | <style>
| |
- | body {
| |
- | margin: 0px;
| |
- | padding: 0px;
| |
- | }
| |
- | #myCanvas {
| |
- | border: 1px solid #9C9898;
| |
- | }
| |
- | </style>
| |
- | <script>
| |
- | window.onload = function() {
| |
- | var canvas = document.getElementById("myCanvas");
| |
- | var context = canvas.getContext("2d");
| |
- | var imageObj = new Image();
| |
| | | |
- | imageObj.onload = function() {
| |
- | context.drawImage(imageObj, 69, 50);
| |
- | };
| |
- | imageObj.src = "http://www.html5canvastutorials.com/demos/assets/darth-vader.jpg";
| |
- | };
| |
- |
| |
- | </script>
| |
- | </head>
| |
- | <body>
| |
- | <canvas id="myCanvas" width="578" height="400"></canvas>
| |
- | </body>
| |
- | </html>
| |
Latest revision as of 15:42, 1 June 2012