*新闻详情页*/>
日期:2020-12-17 类型:科技新闻 我要分享
关键词:ps网页版在线制作,静态网页制作方法,微云网页版,怎么制作一个网页,django网页模板
创建三次方贝塞尔曲线路径。曲线的起始点为路径中前一个点。
第一个贝塞尔控制点的 x 坐标
第一个贝塞尔控制点的 y 坐标
第二个贝塞尔控制点的 x 坐标
第二个贝塞尔控制点的 y 坐标
结束点的 x 坐标
结束点的 y 坐标
const ctx = wx.createCanvasContext('myCanvas')
// Draw points
ctx.beginPath()
ctx.arc(20, 20, 2, 0, 2 * Math.PI)
ctx.setFillStyle('red')
ctx.fill()
ctx.beginPath()
ctx.arc(200, 20, 2, 0, 2 * Math.PI)
ctx.setFillStyle('lightgreen')
ctx.fill()
ctx.beginPath()
ctx.arc(20, 100, 2, 0, 2 * Math.PI)
ctx.arc(200, 100, 2, 0, 2 * Math.PI)
ctx.setFillStyle('blue')
ctx.fill()
ctx.setFillStyle('black')
ctx.setFontSize(12)
// Draw guides
ctx.beginPath()
ctx.moveTo(20, 20)
ctx.lineTo(20, 100)
ctx.lineTo(150, 75)
ctx.moveTo(200, 20)
ctx.lineTo(200, 100)
ctx.lineTo(70, 75)
ctx.setStrokeStyle('#AAAAAA')
ctx.stroke()
// Draw quadratic curve
ctx.beginPath()
ctx.moveTo(20, 20)
ctx.bezierCurveTo(20, 100, 200, 100, 200, 20)
ctx.setStrokeStyle('black')
ctx.stroke()
ctx.draw()
针对 moveTo(20, 20) bezierCurveTo(20, 100, 200, 100, 200, 20) 的三个关键坐标如下:
Copyright © 2002-2020 ps网页版在线制作_静态网页制作方法_微云网页版_怎么制作一个网页_django网页模板 版权所有 (网站地图) 粤ICP备10235580号