サンプル:
http://html5next.appspot.com/canvas1.html
ソース:
<canvas id="cvs01" height="250" width="250" style="border:1px solid black;">
</canvas>
<script type="text/javascript">
function drawCanvas()
{
var objCanvas = document.getElementById("cvs01");
var objContext = objCanvas.getContext("2d");
// Create a path in absolute coordinates
objContext.beginPath();
objContext.moveTo(70, 140);
objContext.lineTo(140, 70);
// Stroke the line onto the canvas
objContext.strokeStyle = "red";
objContext.stroke();
}
drawCanvas();
</script>
0 件のコメント:
コメントを投稿