CanvasContext.stroke

解释:画出当前路径的边框。默认颜色为黑色。

# 方法参数

# 示例

扫码体验
重新加载
请使用百度APP扫码

# 图片示例

图片

# 代码示例

    <canvas canvas-id="myCanvas" class="myCanvas" />
    
    Page({
        onLoad() {
            const canvasContext = swan.createCanvasContext('myCanvas');
            canvasContext.moveTo(100, 100);
            canvasContext.lineTo(10, 100);
            canvasContext.lineTo(10, 10);
            canvasContext.stroke();
            canvasContext.draw();
        }
    });