网站首页 > 技术文章 正文
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 );
???????
???????
?????????????????????????????????????
???????????????????
???
????????????????????????£??????л??
猜你喜欢
- 2025-07-08 关于前端水印(前端 水印)
- 2025-07-08 px、rem、em的区别、浏览器的默认字体大小
- 2024-10-11 Windows XP、ClearType 和微软雅黑字体的那点事
- 2024-10-11 前后端数据交互(四)——fetch 请求详解
- 2024-10-11 小白总结:前端HTML基础知识点(1)——元素总结
- 2024-10-11 领导给了你大块文字,晦涩难懂,还要有设计感,快来解救我吧!
- 2024-10-11 零基础教你学前端——66、CSS谷歌字体和Icon图标
- 2024-10-11 「前端添加水印」你真的了解全面吗?
- 2024-10-11 前端OCR图片文字提取功能 #ocr识别
- 2024-10-11 一起学 pixijs(4):如何绘制文字 pic字设怎么上色
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 前端设计模式 (75)
- 前端性能优化 (51)
- 前端模板 (66)
- 前端跨域 (52)
- 前端缓存 (63)
- 前端aes加密 (58)
- 前端脚手架 (56)
- 前端md5加密 (54)
- 前端路由 (61)
- 前端数组 (73)
- 前端js面试题 (50)
- 前端定时器 (59)
- Oracle RAC (76)
- oracle恢复 (77)
- oracle 删除表 (52)
- oracle 用户名 (80)
- oracle 工具 (55)
- oracle 内存 (55)
- oracle 导出表 (62)
- oracle约束 (54)
- oracle 中文 (51)
- oracle链接 (54)
- oracle的函数 (58)
- oracle面试 (55)
- 前端调试 (52)
本文暂时没有评论,来添加一个吧(●'◡'●)