canvas的基础知识

参考自:https://www.jianshu.com/p/6380bcae8f81

context.moveTo();指定所绘直线的起点坐标 To
context.lineTo();指定所绘直线的终点坐标
context.stroke();绘制

 

context.beginPath();
context.clocePath();封闭所绘的多边形Path 
context.fillStyle用于设置所绘箭头的填充色
context.strokeStyle用于设置所绘箭头的边框色

context.rect(x,y,width,height)   rectangle
context.fillRect(x,y,width,height);绘制带填充色的矩形 【可用fillStyle stroke代替】
context.strokeRect(x,y,width,height);绘制带边框色的矩形

 

lineCap用于设置线条两端的形状。包含三个值:butt(默认值)、"round"(圆头)、square(方头)

lineJoin用于设置线条与线条相交时呈现的状态。包含三个值:miter(默认值)、bevel、round(圆头

 

posted @   lxq3280  阅读(59)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示