html
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Canvas element size: 600 x 300, Canvas drawing surface size: 600 x 300</title> <style> body { background: skyblue; } #canvas { margin: 10px; padding: 10px; background: white; border: thin inset gray; } </style> </head> <body> <canvas id='canvas' width='600' height='300'> Canvas not supported </canvas> <script src='example.js'></script> </body> </html>
js
var canvas = document.getElementById('canvas'), context = canvas.getContext('2d'); //???????? context.font = '38px Arial'; //?????????? context.fillStyle = 'red'; //????????????? context.strokeStyle = 'blue'; //????? context.fillText("???????365", canvas.width/2 - 150,canvas.height/2 + 15); //?????? context.strokeText("???????365", canvas.width/2 - 150,canvas.height/2 + 15 );
???????
???????
?????????????????????????????????????
???????????????????
???
????????????????????????£??????л??