1.1.1 • Published 3 years ago

clear-picture v1.1.1

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

简介

clear-picture 可以用于手指涂抹清除图片的场景,类似于刮刮卡。

安装

使用 npm 安装:

$ npm i clear-picture --save

使用

import ClearPicture from 'clear-picture';

const cp = new ClearPicture({
   canvas: document.getElementById('canvas'), // 页面中的 canvas 元素
   background: require('../assets/draw_image.jpg'), // 用于涂抹的背景,涂抹完成后消失 
   canvasWidth: 500, // canvas 宽度
   canvasHeight: 500, // canvas 高度
   lineWidth: 60, // 画笔粗细
   completeRatio: 0.5, // 完成度,最大值为 1
   finishCallback: ()=>{
        // 完成回调
    }, 
});
1.1.1

3 years ago

1.1.0

4 years ago

1.0.0

4 years ago