Code Monkey home page Code Monkey logo

react-native-lewin-screen-capture's Introduction

react-native-lewin-screen-capture

react-native 获取系统截屏通知并获取图片/截取当前屏幕

Table of contents

Install

1: yarn add 或者npm install,现在最新版本是1.1.0 支持0.6X版本 androidx

yarn add react-native-lewin-screen-capture

2: yarn install 或 npm install

3: react-native link react-native-lewin-screen-capture

Usage

NOTE: 可以参考Example的App.js中的方法

import ScreenCaptureUtil from 'react-native-lewin-screen-capture'

// 开始监听
ScreenCaptureUtil.startListener(res=>{
            console.log(res)
            // this.setState({uri:'data:image/png;base64,' + res.base64})
            this.setState({uri: res.uri})
          }, '截屏,screen')
// 停止监听
ScreenCaptureUtil.stopListener()
// 截取当前屏幕
ScreenCaptureUtil.screenCapture((res)=>{
            console.log(res)
            this.setState({uri: res.uri})
          })
// 清理缓存
ScreenCaptureUtil.clearCache()

react-native-lewin-screen-capture's People

Contributors

hans00 avatar lewinjun avatar

Watchers

James Cloos avatar  avatar

Forkers

mybigday

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.