Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- window.onload = function () {
- var canvas = document.getElementById('canvas');
- if (canvas && canvas.getContext) {
- var context = canvas.getContext('2d');
- var myImage = new Image();
- var cw = Math.floor(canvas.clientWidth);
- var ch = Math.floor(canvas.clientHeight);
- canvas.width = cw;
- canvas.height = ch;
- myImage.onload = function () {
- context.drawImage(myImage, 0, 0, cw, ch);
- }
- myImage.src = "content/bg.jpg";
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement