A solution to the rotation problem in preview screen when calling Camera in Android programming

This article describes the solution to the rotation problem in preview screen when calling Camera in Android programming. Share with you for your reference, as follows:

When calling camera to write an application, the situation of the front and rear cameras is sometimes different. Sometimes, there is no problem with the rear camera, but when calling the front camera, it reverses 180 ° or other angles, which is hard to understand. After looking at the Android source code, I found that its solution is very good. Next, post a source code for future viewing.

When calling camera, just call the setcameradisplayorientation method.

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>