Skip to content

Instantly share code, notes, and snippets.

@rbtnn
Created November 1, 2014 09:40
Show Gist options
  • Save rbtnn/a0794bea188aeab25965 to your computer and use it in GitHub Desktop.
Save rbtnn/a0794bea188aeab25965 to your computer and use it in GitHub Desktop.
<!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