sdwwld / camerax Goto Github PK
View Code? Open in Web Editor NEWAndroid手机使用CameraX拍照,比Camera2更简洁,可以使用前置以及后置摄像头,自动对焦,以及证件照并实现剪切功能
Android手机使用CameraX拍照,比Camera2更简洁,可以使用前置以及后置摄像头,自动对焦,以及证件照并实现剪切功能
拍照完成 连续点击保存 崩溃了
我理解错了,拍完第一张,要延迟个一秒 500毫秒再打开就没事儿了,估计释放资源需要时间吧
invoke virtual method 'void androidx.camera.lifecycle.ProcessCameraProvider.unbindAll()' on a null object reference
应该是下面方法的问题。
@Override
protected void onDestroy() {
super.onDestroy();
autoFocusCancel();
cameraProvider.unbindAll();
// if (cameraExecutor != null)
// cameraExecutor.shutdown();
}
调用库时一直在报这个错You need to use a Theme.AppCompat theme (or descendant) with this activity.,然后程序崩溃退出
我的设备是android开发板,没有内置前置后置摄像头,只有一个usb外置摄像头。因此摄像头数量为1.
setShowSwitch(true)时,切换按钮时会报错。
setFront(true)时,直接报错No available camera can be found
希望能对此场景进行异常处理,谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.