相机API示例?
我想使用以下网页示例开发一个相机演示应用程序。 http://marakana.com/forums/android/examples/39.html
拍照后,我想在主要活动中显示捕获的图像。我该怎么做?谢谢。
I want to develop a camera demo app using the following web page example.
http://marakana.com/forums/android/examples/39.html
After taking a photo, I want to display the captured image in the main activity. How can I do this? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好用另一个例子。我无法让这个工作。从SO中的其他相机问题来看,我认为很多人都有同样的问题。但在完全放弃 Marakana 的示例之前,请尝试将元素移到元素之外。并包括忘记的马科。
通过这样做,我克服了 RuntimeException,现在得到了一个完全不同的错误,我认为该错误是我的手机特有的:它试图创建一个“无效预览尺寸”为 480x604 的预览。但 Marko 的代码根据创建的预览表面的大小设置大小,因此手机本身默认为预览表面的无效大小。
Best to use another example. I can't get this one to work. Judging by the other Camera questions in SO, I think lots of people have the same problem. But before you give up on Marakana's example completely, try moving the elements OUTSIDE the element. And include the Marko forgot.
By doing that, I got past the RuntimeException, and now get a completely different error, one I think is specific to my phone: it is trying to create a Preview with an 'invalid preview size' of 480x604. But Marko's code sets the size from the size of the preview surface created,, so the phone itself is defaulting to an invalid size for the Preview surface.