canvasContext.strokeRect
解释:画一个矩形(非填充)。
参数:
参数名 | 类型 | 说明 |
---|---|---|
x | Number | 矩形路径左上角的 x 坐标 |
y | Number | 矩形路径左上角的 y 坐标 |
width | Number | 矩形路径的宽度 |
height | Number | 矩形路径的高度 |
示例:
- const ctx = swan.createCanvasContext('myCanvas');
ctx.setStrokeStyle('blue');
ctx.strokeRect(30, 30, 150, 75);
ctx.draw();