安卓相机变焦
我开发了一个相机应用程序,可以拍摄照片,将其存储到缓存,然后加载它 到服务器。一切都很完美。然而,当我在真实手机上测试它时,我注意到缩放相机会使应用程序崩溃。我花了两周时间尝试让变焦功能发挥作用并对其进行研究。我尝试过 setOnZoomListener、isSmoothZoomSupported 等。 但是,无论我做什么,我都找不到一种方法来实现应用程序中的缩放功能而不崩溃。任何方向正确的点将其组合在一起都会挽救我的理智!提前非常感谢!!!!
I developed a camera application that takes a picture, stores it to cache, then loads it
to a server. Everything works perfect. However, when I went to test it on a real phone, I noticed that zooming the camera crashing the app. I have spent 2 weeks trying to get the zoom to work and researching it. I have tried setOnZoomListener, isSmoothZoomSupported etc.
however, no matter what I do, I can't find a way to implement the zoom feature in the app without it crashing. Any point in the right direction to put this together would save my sanity!! Thank you so much in advance!!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
手机相机的变焦功能是数码变焦而不是光学变焦。
因此,变焦取决于相机硬件。
尝试使用Camera.Parameters.getMaxZoom()获取相机的最大变焦值
如果此方法返回缩放值>1,则您可以缩放图片预览。
这取决于硬件。因此,某些设备可能支持某些设备可能不支持。
谢谢
维卡什
The zoom feature of mobile camera is digital zoom not the optical zooming.
So, the zooming is dependent on the camera hardware.
try to get the max zoom value of the camera by using
Camera.Parameters.getMaxZoom()
if this method returns zoom value>1 then you are able to zoom the picture preview.
And this is hardware dependent. So, some devices may support some may not.
thanks
Vikash