[asp]代码库
<!DOCTYPE HTML>
<html>
<body>
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>
<script type="text/javascript">
var c=document.getElementById("myCanvas");
var cxt=c.getContext("2d");
var img=new Image();
img.src="http://pic.cnitblog.com/face/u109505.bmp?id=24183340";
var img2=new Image();
img2.src="http://pic.cnitblog.com/face/75468/20130710131911.png";
cxt.drawImage(img,0,0);
cxt.drawImage(img,50,50);
cxt.drawImage(img,100,0);
cxt.drawImage(img,150,50);
cxt.drawImage(img2,50,0);
cxt.drawImage(img2,0,50);
cxt.drawImage(img2,100,50);
cxt.drawImage(img2,150,0);
</script>
</body>
</html>
[代码运行效果截图]