GithubHelp home page GithubHelp logo

wx-cropper's Introduction

更新日志

2018.10.28

  • 编写2.0版本,添加裁剪区域宽度高度比例的控制,而不是以往的750 * 750 而导致页面显示的内容不充分的视觉效果(通过 CROPPER_RATIO 来控制cropper的宽高比例 默认是0.6666 接近于宽640 / 高960)
  • 添加固定比例裁剪功能 CROPPER_AREA_RATIO 在设置为 > 0 的number值的时候可以控制裁剪的比例,比例也是宽高的比,如果是正方形则为1,如果不想有比例的裁剪,这个常量设置为0 即可
  • 优化界面UI
  • 这些代码还有部分问题,暂时没有放到master,有需要或者了解的可在v2分支拉取代码

2018.8.16

  • 代码重写,裁剪机制变化
  • 修复安卓机裁剪时卡顿的问题
  • 修复裁剪边框超出的问题

2018.4.23

  • 新增图片质量控制,参数为qualityWidth,避免图片过大时导致内存溢出
  • 新增本地图片上传裁剪功能

wx-cropper

微信小程序 图片裁剪工具,简单易用

QQ交流群: 424418160

项目需求

在做微信小程序的时候有个图片上传之前裁剪的需求,找过一些github中的项目,都不太理想,主要是没有办法自定义宽高,于是自己研究了一下,做了一个简单的图片裁剪效果

使用方法

项目里面直接放的该功能的文件,将这个文件夹复制到小程序项目中,在app.json中启动该页面即可看到效果

注意:这里面的图片在你们的项目中可能会无法使用,在测试的话 可以用自己本地或者你们项目服务器下的图片地址

显示效果

裁剪之前的效果

裁剪之后的效果

wx-cropper's People

Contributors

1c7 avatar ifmiss avatar tangentlu666 avatar

Stargazers

 avatar

Watchers

 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.