Git Product home page Git Product logo

Comments (9)

beautifulSoup avatar beautifulSoup commented on July 30, 2024

稍等,有点事在忙

from rtmprecoder.

y1787165 avatar y1787165 commented on July 30, 2024

好的,您慢来!

from rtmprecoder.

beautifulSoup avatar beautifulSoup commented on July 30, 2024

Camera 这个类的默认展示方向是横向的,它有一个setDisplayOrientation(int degrees) 方法,传入90 度就可以变成纵向的了。不过这个类现在已经被Deprecated 了,这是我很久之前写的一个demo项目,所以一直也没改,建议你换成Camera2

from rtmprecoder.

beautifulSoup avatar beautifulSoup commented on July 30, 2024
public CameraView(Context context, Camera camera) {
            super(context);
            Log.w("camera", "camera view");
            mCamera = camera;
            mHolder = getHolder();
            mHolder.addCallback(CameraView.this);
            mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
            mCamera.setPreviewCallback(CameraView.this);
            mCamera.setDisplayOrientation(90);
        }

可以加在CameraView的构造函数里面或者获取到Camera对象的时候

from rtmprecoder.

y1787165 avatar y1787165 commented on July 30, 2024

谢谢,我成功试出来了,另外我试了下,这个 view 长宽比似乎要符合16.2比12.4,否则的话影像的比例会有偏差,请问这是正常现象吗

from rtmprecoder.

beautifulSoup avatar beautifulSoup commented on July 30, 2024

不是 你看add camera view注释下面那段 是根据屏幕长款设置 CameraView的长宽,因为你把Camera设成竖直的了,所以那里的长宽设置倒过来了,你可以相应换下就好了应该。我回家了手上没有环境,你先自己试一下吧。

from rtmprecoder.

y1787165 avatar y1787165 commented on July 30, 2024

是这样的,我把这个 view 设成全萤幕了,但是比例跟一般相机相差满多的,我在猜会不会是 camera 抓下来的大小是固定的关系,这边我给个两张图来看看比较清楚

2016-10-10 12 05 47

2016-10-10 12 05 38

from rtmprecoder.

beautifulSoup avatar beautifulSoup commented on July 30, 2024

是的,只支持几种固定尺寸 你可以google一下Android Camera 拉伸问题 上面会有解决方案

from rtmprecoder.

y1787165 avatar y1787165 commented on July 30, 2024

非常感谢,研究后解决了

from rtmprecoder.

Related Issues (10)

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.