8000 GitHub - lvangorysky/Ypaint: canvas draw picture
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lvangorysky/Ypaint

Repository files navigation

Ypaint

引入

npm i ypaint

使用方法

import Paint from 'ypaint'

let paint = document.getElementById('canvas')
let newPaint = new Paint(paint);

方法参数

绘制矩形:

newPaint.init({
    drawWay: 'rectangle',
    lineWidth: 4, 
    color: 'red',
    radius: 2,
    rectangleType: 'stroke'
})

画笔工具:

newPaint.init({
    drawWay: 'pencil',
    lineWidth: 4, 
    color: 'red',
});

绘制箭头:

newPaint.init({
    drawWay: 'arrow',
    lineWidth: 4, 
    color: 'red',
})

绘制圆形:

newPaint.init({
    drawWay: 'circel',
    lineWidth: 4, 
    color: 'red', 
    fillColor: 'blue'
});

About

canvas draw picture

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0