canvas

发布于 7 年前作者 panyong17386 次浏览最后编辑 7 年前来自 ask

canvas 怎么画出1像素的细线?我画的貌似太粗了。。。

ctx.beginPath()
ctx.setLineWidth('1rpx')
ctx.setStrokeStyle('DarkGray')
ctx.moveTo(28, locationTop)
ctx.lineTo(screenWidth-28, locationTop)
ctx.stroke()
0 回复
暂无回复