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

react-native-picedit

v1.1.8

Published

## Getting started

Downloads

19

Readme

react-native-picedit

开始使用

$ npm install react-native-picedit --save

关联依赖

$ react-native link react-native-picedit 如果失败,请看手动集成。

也可以手动安配置

Android 手动集成步骤

  1. 打开 RN 主工程找到文件:android/app/src/main/java/[...]/MainActivity.java
  • 导入包名 import com.iwhalecloud.picedit.RNPiceditPackage; 到这个文件
  • 添加 new RNPiceditPackage()getPackages() 方法
  1. 修改 android/settings.gradle 文件:

    include ':react-native-picedit'
    project(':react-native-picedit').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-picedit/android')
  2. 主工程引用 android/app/build.gradle: compile project(':react-native-picedit')

  3. 模块组件下面有使用例子:demo.js

分别介绍了两种使用:

  • 1、直接使用原生组件模块调用唤起原生界面
  • 2、使用 UI 组件模块,前端页面配置使用

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-picedit and add RNPicedit.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNPicedit.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

使用

#项目里需要添加图片引用,正式打包才会添加到对应的应用目录
import test from "../../Images/top_logo.png";
import PhotoEditer from "react-native-picedit";

// TODO: What to do with the module?
<Button
          title={"点击图片编辑"}
          onPress={() => {
            const data = {};
            data.orign =
              "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1561380079906&di=368d275b2ad6dfea75d35034b3c44aa8&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201603%2F06%2F20160306224210_TRBaQ.jpeg";
            data.maxSize = "1024";
            data.iconsNumber = 6; // [0-5]
            data.scale = false;
            data.icons = [
              "d",
              "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAr0lEQVR4Xu3cQQ3AMBADQbsqf8oXCnlfZimM/HWTTBY0M9nQl8sEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiA6N/yxNb2rYUICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBAB0QFKqwfGDn71VAAAAABJRU5ErkJggg==",
              "https://hifond-oss.oss-cn-shanghai.aliyuncs.com/test.png"
            ];
            console.log(data);
            PhotoEditer.openPicEdit(data,(uri, data) => {
              console.log(uri);
            });
          }}
        />

<PhotoEditer
  style={{ width: "100%", height: 300 }}
   source={
          "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1561380079906&di=368d275b2ad6dfea75d35034b3c44aa8&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201603%2F06%2F20160306224210_TRBaQ.jpeg"
            }
            //  android 离线包路径是目录拼接到drawable下面
            //  import testPng from "./top_logo.png";  打印是数字 2
            //  框架对应的目录:
            // ""
            //  如果是项目图片路径 请使用相对路径字符串形式 eg: "node_modules/rnlmphotoeditertest/top_logo.png"
            marks={[
              "d",
              // "node_modules/rnlmphotoeditertest/top_logo.png",
              PhotoEditer.toUrl("app/Images/top_logo.png"),
              "https://hifond-oss.oss-cn-shanghai.aliyuncs.com/result.png",
              "https://hifond-oss.oss-cn-shanghai.aliyuncs.com/test.png"
            ]}
  onComplete={msg => {
    alert(msg.base64);
    console.log(msg.uri);
    console.log(msg.base64);
  }}
  onCancel={msg => {
    alert(msg.result);
    console.log(msg.result);
  }}
  onError={msg => {
    alert(msg.result);
    console.log(msg.result);
  }}
/>;