<canvas> image
Html viết:
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function(){
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
var x = 0; //Vị trí đặt hình, theo tọa độ x
var y = 0; //Vị trí đặt hình, theo tọa độ y
var canvasImg = new Image();
canvasImg.onload = function(){
context.drawImage(canvasImg, x, y);
};
canvasImg.src = "images/img_flower.jpg";
};
</script>
</head>
<body>
<canvas id="myCanvas" width="578" height="300"></canvas>
</body>
</html>

