如何将图像添加到画布中
HTML
<canvas id="viewport"></canvas>
CSS
canvas#viewport { border: 1px solid white; width: 900px; }
JS
var canvas = document.getElementById('viewport'),context = canvas.getContext('2d');make_base();function make_base(){ base_image = new Image(); base_image.src = 'img/base.png'; context.drawImage(base_image, 100, 100);}
桃花长相依
达令说
相关分类