simple-react-drawing-canvas
v1.9.1
Published
simple canvas drawing with polygon and line toolset.
Downloads
5
Readme
simple-react-drawing-canvas
simple canvas drawing with polygon and line toolset.
Install
npm install --save simple-react-drawing-canvas
Usage
import React, { Component } from 'react'
import DrawingCanvas from 'simple-react-drawing-canvas'
class Example extends Component {
state = {
canvasImagePreview: null
}
handleOnFinish = (linesCoordinate) => {
// List of list coordinate
console.log(linesCoordinate)
}
render () {
const canvasSize = {
canvasHeight: 480;
canvasWidth: 480
}
return (
<DrawingCanvas
canvasSize={canvasSize}
canvasImagePreview={canvasImagePreview}
onFinish={this.handleOnFinish}
/>
)
}
}
License
MIT © fajarkarim