캔버스에 페인트하는 방법을 알려주시겠습니까? 다음은 HTML 5 코드는 다음과 같습니다캔버스에 페인트하는 방법?
var TableHeight = 300,
TableWidth = 500,
function init() {
canvas = document.getElementById('canvas');
context = canvas.getContext('2d');
table.draw();
}
table = {
color: '#000',
PositionX : 1,
PositionY: 1,
width: TableWidth,
height: TableHeight,
draw: function(){
context.fillStyle = this.color;
context.fillRect = (this.PositionX, this.PositionY, this.width, this.height);
context.clearRect(5, 5, TableWidth - 10, TableHeight - 10);
}
}
여기 내 HTML 코드
내 영어 죄송합니다<body>
<canvas id ='canvas' width = 500px height = 300px ></canvas>
<script>init()</script>
</body>
입니다.
내가 코드에 문제가있는 가정이 질문에 정확한 쿼리를 지적하시기 바랍니다. – Rndm