Coder Social home page Coder Social logo

canvas-roi's Introduction

CanvasRoi

组件主要用于在图片或视频提供绘制选区并将选区数据输出。

2.0版本支持vue3

2.1版本支持react

从2.1版本开始,默认导出不再是vue组件,而是CanvasRoi类。vue组合和react组件分别放在对应的独立文件中。避免相互干扰

如何安装

NPM:

npm install @micah2015/canvas-roi --save

CDN:

<script src="[npm url]/[pkg@version]/index.js"></script>

用法示例

<div class="roi-container">
  <img src="pic.jpg" alt="">
</div>
import { CanvasRoi } from '@micah2015/canvas-roi';

const roi = new CanvasRoi('.roi-container', {
  // input回调函数可从组件内接收数据的变化
  input: value => {}
});
// 也可以外部设置组件的数据
roi.setValue(value)

详细说明可查看仓库内文档 Document

License

MIT

⬆ back to top

canvas-roi's People

Contributors

dependabot[bot] avatar wxhccc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.