Created
November 1, 2014 09:40
-
-
Save rbtnn/a0794bea188aeab25965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- <script type="./jsPDF-0.9.0rc2/jspdf.js"> --> | |
</head> | |
<body> | |
<canvas width="400" height="200" id="sample" style="background-color: #eeffee;"> | |
</canvas> | |
<script type="text/javascript"> | |
(function(){ | |
var canvas = document.getElementById('sample'); | |
if (canvas.getContext) { | |
var ctx = canvas.getContext('2d'); | |
var img02 = new Image(); | |
img02.src = "./img/c0hama.bmp"; | |
img02.onload = function() { | |
ctx.drawImage(img02, 20, 10, 100, 100); | |
} | |
var img01 = new Image(); | |
img01.src ="./a.png"; | |
img01.onload = function() { | |
ctx.fillStyle = "rgb(0, 160, 0)"; | |
ctx.fillRect(0, 120, 1000, 120); | |
ctx.drawImage(img01, 130, 130); | |
} | |
var img03 = new Image(); | |
img03.src = "./vimconficon.png"; | |
img03.onload = function() { | |
ctx.drawImage(img03, 0, 120, 80, 80); | |
} | |
ctx.font = "20pt Arial"; | |
ctx.fillText("@c0hama", 180, 80); | |
} | |
})(); | |
</script> | |
#56c942 | |
#34852e | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment