Giter Site home page Giter Site logo

leevanie / camerademo Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 156 KB

自定义相机满足拍照基本功能,只做了竖屏拍照,前后摄像头切换,预览画面和照片旋转,手动点击区域聚焦,双指滑动镜头缩放,seekBar按钮控制镜头缩放

Java 100.00%

camerademo's People

Contributors

leevanie avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

zhanganl

camerademo's Issues

onPictureTaken里面返回的bitmap是空字符串

` 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也都是返回“”,换了手机又有值了

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.