SurfaceView旋转问题
我遇到过一种情况,我正在使用 SurfaceView 来录制视频。但是当我尝试以纵向模式录制时,surfaceView
显示横向模式下的预览。有没有办法可以旋转 SurfaceView 或让我的相机旋转 90 度。
I have a situation where I am using SurfaceView
fro recording an Video. But when I try to record in portrait mode, the surfaceView
shows me the preview in landscape mode. Is there a way that i could rotate the surfaceView
or make my camera to rotate at an angle of 90 degrees.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要点是相机表面仅在风景模式下才能正常工作。据我所知,只有最新版本的 SDK 修正了该功能。但是,虽然大多数手机使用 2.2、2.3,但现在您应该使用横向进行相机活动。这里有一个问题。毕竟,您必须旋转结果视频。
有一些技巧可以避免此功能(http://stackoverflow.com/questions/4645960/how-to-set-android-camera-orientation-properly),但它们不适用于所有设备,我不能建议使用它们。
The point is Camera surface works properly only in landscpe mode. As far as I know only last release of SDK corrects that feature. But while the most phones use 2.2, 2.3 now you should use landscape orientation for camera activity. There is one problem here. You will have to rotate you result video afterall.
There are couple hacks to avoid this featue (http://stackoverflow.com/questions/4645960/how-to-set-android-camera-orientation-properly) but they don't work on all devices and I can't suggest using them.