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 @ 2022-07-05 10:32  lxq3280  阅读(64)  评论(0)    收藏  举报