npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

image-overlays-realman

v1.0.20

Published

睿尔曼智能科技图片标注功能

Downloads

6

Readme

image-overlays-realman

##使用方法 example

import DrawImgTovancas from 'image-overlays-realman'

API

DrawImgTovancas.loadImageToCanvas(Dom id,image url)
DrawImgTovancas.loadVideoTocanvas(Dom id,video url)
DrawImgTovancas.fillColor() set color
DrawImgTovancas.dowmload() img
DrawImgTovancas.videoPlay() palay video

支持ctrl + z 撤回操作

调用 removeEventLister 移除监听

VUE demo

<template>
    <div>
        <el-button @click="fillColor" type="success">填充选中区域颜色</el-button>
        <el-button @click="download">下载</el-button>
        <input type="file" @change='(e) => uploadFile(e)' name="upload">
        <div id="canvasDemo"></div>
    </div>
</template>
<script setup>
import DrawImgTovancas from 'image-overlays-realman'
import { onMounted, onBeforeUnmount } from 'vue'
const util = new DrawImgTovancas()
const fillColor = () => util.fillColor()
const download = () => util.download()
const uploadFile = e => {
    util.uploadFile(e.target.files[0]).then(self => {
        self.clear().loadImageToCanvas("canvasDemo",util.url)
    })
   
      // 💠 1.0.17新增  util.uploadFiles(e.target.files[0],'canvasDemo',()=>{return util.setSize(20,30)} ) 
}
onMounted(() => {
    //  util.loadImageToCanvas('canvasDemo','https://cs-scm.oss-cn-hangzhou.aliyuncs.com/2024-01-29/1706524291602-u%3D2606150498%2C3701823879%26fm%3D253%26app%3D138%26size%3Dw931%26n%3D0%26f%3DJPEG%26fmt%3Dauto.realmanp')

})
onBeforeUnmount(() => {
    util.removeEventListener()
})
</script>
<style  scoped></style>

| 序号 | 属性/function | 名称 | 用法 | | :---------: | :---------: | :---------: | :---------: |
| 1 | loadImageToCanvas(DomId,imageUrl) 必传 | 渲染图片 | 参照VUE Demo |
| 2 | loadVideoToCanvas(DomId,videoUrl) 必传 | 渲染图片 | 同上 |
| 3 | ctrl + z | 撤回操作 | -- |
| 4 |DrawImgTovancas(color) 非必传 | 初始化 | 实例化 参照VUE Demo |
| 5 | getPoints() | 获取标记坐标 | const points = util.getPoints() |
| 6 | removeEventListener() | 移除监听 | 组建销毁,页面关闭时触发 | | 7 | fillolor() | 选中区域填充颜色 | -- | | 8 | download(name='down',type=null) | 下载图片 | name 下载文件名称,自动加时间结尾;type === null 正常下载 ;!==null下载标注部分| | 9 | videoPlay() | 播放视频 | -- | | 10 | clear() | 切换图片调用,清除缓存数据和事件监听 | -- | | 11 | uploadFile() | 本地上传图片/视频 | 参照VUE Demo | | 11 | uploadFiles() 💠 1.0.17新增| 本地上传图片/视频 | 参照VUE Demo | | 12 | setSize() 💠 1.0.17新增| 设置canvas 宽高| 本地上传参照VUE Demo;网络图片必须在调用loadImageToCanvas 或loadVideoToCanvas 前调用|