开发者

Android Camera Orientation Problem

开发者 https://www.devze.com 2023-03-29 23:54 出处:网络
I am developing android application. In that I have functionality of camera. I have implemented that and its working fine for me. Only thing is preview o开发者_StackOverflowf my camera, orientation is

I am developing android application. In that I have functionality of camera. I have implemented that and its working fine for me. Only thing is preview o开发者_StackOverflowf my camera, orientation is not correct its rotated. Is anybody having solution on that.


Which API are you using? If it's 1.5 or 1.6 (API 4 & API 5) there is a bug about orientation of camera. Do you see 90 degree rotated view? Check this link

If you are using SurfaceView, there is a possible solution to this problem (let c is your camera object)

Camera.Parameters p = c.getParameters();
parameters.set("orientation", "portrait");
parameters.set("rotation", 90);
c.setParameters(p);

Hope it works well for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号