leevanie / camerademo Goto Github PK
View Code? Open in Web Editor NEW自定义相机满足拍照基本功能,只做了竖屏拍照,前后摄像头切换,预览画面和照片旋转,手动点击区域聚焦,双指滑动镜头缩放,seekBar按钮控制镜头缩放
自定义相机满足拍照基本功能,只做了竖屏拍照,前后摄像头切换,预览画面和照片旋转,手动点击区域聚焦,双指滑动镜头缩放,seekBar按钮控制镜头缩放
` public Bitmap decodeSampledBitmapFromByte(byte[] bitmapBytes) {
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
options.inMutable = true;
options.inBitmap = BitmapFactory.decodeByteArray(bitmapBytes, 0,
bitmapBytes.length, options);
// Calculate inSampleSize
options.inSampleSize = calculateInSampleSize(options, ScreenUtils.getScreenWidth(this),
ScreenUtils.getScreenHeight(this));
// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false; // If set to true, the decoder will
options.inPurgeable = true; // Tell to gc that whether it needs free
options.inInputShareable = true; // Which kind of reference will be used
return BitmapFactory.decodeByteArray(bitmapBytes, 0,
bitmapBytes.length, options);
}`
用的是小米,Android8.0,刚开始几次还是有值的,后面就一直返回空字符串了,这个bitmap又不是null,换了网上的几种字节数组转bitmap也都是返回“”,换了手机又有值了
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.