Camera API: Cross device issues

后端 未结 3 1899
野趣味
野趣味 2021-02-07 13:30

I\'m developing a camera app basically as part of a messaging app to attach images etc. The app needs to work for >= SDK 2.2 and:

I can\'t use the defau

3条回答
  •  广开言路
    2021-02-07 13:39

    Android camera system is a mess. And beind soldered to motherboard, camera chip is not going to like portait application - all the callbacks spill out data in camera orientation (buffer you receive is actually shared memory piece with native camera app) - if you like to display it while your application is in portait mode, you will have to flip this data over xy.

    Instead of showing image on the surface view used by camera, I would overlay it with transparent ImageView and draw my bitmap there.

    You may (hopefully) find some inspiration in out javaocr project where android deamon work in portrait mode and draw bitmaps over live preview. (please checkout from git, as it is being released now and I'm struggling with git and maven, see demos directory)

提交回复
热议问题