clear-picture

1.1.1 • Public • Published

简介

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: ()=>{
        // 完成回调
    }, 
});

Package Sidebar

Install

npm i clear-picture

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

4.42 kB

Total Files

4

Last publish

Collaborators

  • ningbo