那里错了,当使用context.drawImage( image , 0 , 0 )可以显示1个,但当不用时无法显示图,各位大神,请指教
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<canvas id="canvas" style ="divplay:block;margin:0 auto;border:1px solid #aaa;"><!--显示画布框架-->
当前浏览器不支持Canvas,请更换浏览器后再试
</canvas>
<script src="digit.js"></script>
<script src="countdown.js"></script>
<script>
var image = new Image()
image.src = "s7.ico"
image.onload = function(){
var pattern = context.createPattern(image ,"repeat_x");
// context.drawImage( image , 0 , 0 )
context.fillStyle = Pattern
context.fillRecf( 0 , 0 , 800 , 800 )
}
}
</script>
</body>
</html>