CameraCardCropDemo

一个卡片(证件)拍照裁剪框架。

Gradle

compile 'me.zhouzhuo810.cameracardcrop:camera-card-crop:1.0.2'

Features

Support Android 6.0 permissions.

What does it look like ?

cameracrop2.png

cameracrop1.png

Notice

card

---------------------

| width |

| |

| |height

| |

---------------------

phone

------------------------------------

| |

| |

| |

| |

| |

| mask |

| |

| width |

| ------------------------ |

| | | |

| | height | | screen height

| | rect | |

| | | |

| ------------------------ |

| |

| |

| |

| |

| |

| screen width |

-------------------------------------

CameraConfig.RATIO_WIDTH = card's width

CameraConfig.RATIO_HEIGHT = card's height

CameraConfig.PERCENT_WIDTH = rect'swidth / screen's width

Usage

step 1. Add Activity in your AndroidManifest.xml file.

android:screenOrientation="portrait"

android:theme="@style/Theme.AppCompat.NoActionBar">

step 2. Add permissions in your AndroidManifest.xml file.

step 3. Example for use.

public void takePhoto(View v) {

Intent intent = new Intent(MainActivity.this, CropActivity.class);

intent.putExtra(CameraConfig.RATIO_WIDTH, 855);

intent.putExtra(CameraConfig.RATIO_HEIGHT, 541);

intent.putExtra(CameraConfig.PERCENT_WIDTH, 0.8f);

intent.putExtra(CameraConfig.MASK_COLOR, 0x2f000000);

intent.putExtra(CameraConfig.RECT_CORNER_COLOR, 0xff00ff00);

intent.putExtra(CameraConfig.TEXT_COLOR, 0xffffffff);

intent.putExtra(CameraConfig.HINT_TEXT, "请将方框对准证件拍照");

intent.putExtra(CameraConfig.IMAGE_PATH, Environment.getExternalStorageDirectory().getAbsolutePath()+"/CameraCardCrop/"+System.currentTimeMillis()+".jpg");

startActivityForResult(intent, 0x01);

}

@Override

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

super.onActivityResult(requestCode, resultCode, data);

if (resultCode == RESULT_OK) {

if (requestCode == 0x01) {

String path = data.getStringExtra(CameraConfig.IMAGE_PATH);

ivPic.setImageURI(Uri.parse("file://"+path));

}

}

}

Log

1.0.2 Fix flashlight not support bugs.

1.0.1 Revise layout size.

License

Copyright © zhouzhuo810

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

android拍照身份证边框,Android自定义证件拍照控件之CameraCardCrop相关推荐

  1. 【android免root脚本制作】基于控件的操作——auto.js进阶

    在[android免root脚本制作]自动坐标操作手机--京东金融程序金果摇钱树自动收金果 之后,想要做进一步优化,因为基于坐标点击如何屏幕被移动之类就会点击错位,不同手机还需去适配坐标,甚是麻烦,所 ...

  2. android富文本图片自适应,Android 图片混排富文本编辑器控件

    一.一个Android 图片混排富文本编辑器控件(仿兴趣部落) 1.1 图片混排富文本控件 是一种图片和文字混合在一起的控件,文本之间可以插入图片,类似于网页的排版样式. 1.2 该控件主要是仿兴趣部 ...

  3. android 固定底部 布局_Android系统列表控件

    在android系统控件中,有多个控件可以展示列表数据. 一.ListView 该组件是android中最常用的一个UI组件,用于实现在屏幕上显示多个内容,以便于我们用手指进行滑动. ListView ...

  4. [html] 怎样去除iOS和Android中的输入URL地址的控件条呢?

    [html] 怎样去除iOS和Android中的输入URL地址的控件条呢? setTimeout(scrollTo,0,0,0); 个人简介 我是歌谣,欢迎和大家一起交流前后端知识.放弃很容易, 但坚 ...

  5. Android 图片混排富文本编辑器控件

    概述 一个Android 图片混排富文本编辑器控件(仿兴趣部落) 详细 代码下载:http://www.demodashi.com/demo/12032.html 一.一个Android 图片混排富文 ...

  6. android listview添加数据_Android系统列表控件

    在android系统控件中,有多个控件可以展示列表数据. 一.ListView 该组件是android中最常用的一个UI组件,用于实现在屏幕上显示多个内容,以便于我们用手指进行滑动. ListView ...

  7. php支付密码控件,Android高仿微信支付密码输入控件实例代码

    这篇文章主要为大家详细介绍了Android高仿微信支付密码输入控件的具体实现代码,供大家参考,具体内容如下 像微信支付密码控件,在app中是一个多么司空见惯的功能.最近,项目需要这个功能,于是乎就实现 ...

  8. Android Studio Design界面不显示layout控件的解决方法

    Android Studio Design界面不显示layout控件的解决方法 参考文章: (1)Android Studio Design界面不显示layout控件的解决方法 (2)https:// ...

  9. android怎么查看方法被谁调用,Android中查看布局文件中的控件(view,id)在哪里被调用(使用)...

    在阅读别人的代码时通常是很痛苦的,有时很想要看一看布局中的控件在哪里被调用了,为之很苦恼 在这里提供一种方法. 复制要查看的控件ID,到R文件中搜索到该ID, 接下来就好办的了,选中ID按下Ctrl鼠 ...

最新文章

  1. 超融合架构的优缺点_超融合服务器与传统架构服务器的区别哪?定制服务器厂家简要分析...
  2. send和WSASend区别
  3. unity中链接字符串和变量显示_unity3d根据字符串读取属性.
  4. oracle 索引 lob 迁移,Oracle 11g到19c迁移TB级lob表的酸爽
  5. EL表达式取Map,List值的总结
  6. java学习血泪史目录
  7. 记录一次阿里云Mysql 数据库恢复 qp.xb文件恢复数据
  8. Ubuntu下WPS 快捷键、使用方法总结
  9. 无线WIFI短信认证平台(互亿无线)
  10. 软件测试技术之项目上线流程
  11. Unity单人游戏集合
  12. Firefly互动广告机解决方案
  13. 2009年经典语录雷人总汇
  14. js和jquery获取父级元素、子级元素、兄弟元素的方法
  15. 15计算机应用专业综合理论试卷答案,2013年南通市对口单招计算机应用专业综合理论第二次模拟试卷(含答案).doc...
  16. 判断质数和合数python代码_质数,非质数之Python
  17. 嫦娥四号成功着陆月球背面,实现人类探测器首次在月球背面软着陆!
  18. 狐狸逮兔子实验 c++
  19. 实训项目计算机基础知识实训报告,计算机应用基础(本)形考作业实训2学习实训报告.docx...
  20. 电子商务行业客户服务常见问题FAQ

热门文章

  1. Android-史上最优雅的实现文件上传、下载及进度的监听,flutter热更新方案
  2. oracle查询substr,oracle 查询优化select count(*),sum(bal) from rpt_xd where substr
  3. quartz定时任务不执行
  4. 微信小程序怎么做店铺?看一眼就知道了
  5. 小程序开发经验分享(2)前端开发
  6. 如何人声提取音频?手把手教你提取
  7. 腾讯财经 财经资讯 专题栏目 商业人生
  8. 前端 javaScript 新年倒计时
  9. 可以用什么软件画流程图?看看这几款画流程图软件
  10. react引入渲染markdown文件