Android相机控制拍摄的图像在快门后保持预览的时间
我正在 Android(2.3 及更高版本)中使用 camera.takePicture()
拍照。它工作得很好,但我在不同的设备上遇到奇怪的行为。在我的 Nexus One 上,我拍摄的图像在恢复预览之前会冻结几秒钟。在我的 Transformer 上,它几乎立即恢复到预览。
目前,解决方法是在 onShutter()
事件中调用 camera.stopPreview()
,但这仍然有点奇怪,因为它没有显示您拍摄的照片,它显示了拍摄照片后一瞬间预览看到的内容。在 Transformer 上,您甚至可以看到它“冻结-移动-冻结”,因为它在拍照后冻结了一瞬间,再次开始移动,然后进入 onShutter,并在我调用 stopPreview()
。
有谁知道某个地方的设置,或者我可以调用的一些代码,可以告诉相机在重新启动预览之前保留该图像多长时间?或者更好的是,它根本不会自动释放预览,而是等到我调用 startPreview 吗?
I am taking a picture in Android (2.3 and greater) that takes a picture using camera.takePicture()
. It works great, but I get weird behavior on different devices. On my Nexus One, the image I captured stays frozen for a few seconds before reverting to the preview. On my Transformer, it reverts to the preview almost immediately.
For now, a workaround would be to call camera.stopPreview()
in the onShutter()
event, but that's still a bit weird, since it's not showing the photo you took, it's showing what the preview saw a split second after you took the picture. On the Transformer, you can even see it "freeze-move-freeze" as it freezes for a split second after taking the picture, starts moving again, then gets to onShutter and freezes when I call stopPreview()
.
Does anyone know of a setting somewhere, or some code I could call, that would tell the camera how long to hold onto that image before restarting the preview? Or better yet, have it not automatically release the preview at all, and wait until I call startPreview?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我的设备上,我必须手动重新启动预览,它在拍照后不会自行启动。我使用类似的图片回调
,回调是
PhotoProcessor 保存图像,PHOTO_PREVIEW_LENGTH 是捕获图像显示的长度(以毫秒为单位)。
on my devices I have to restart the preview manually, it doesn't start up itself after taking a picture. I use a picture callback like
and the callback is
PhotoProcessor saves the image, PHOTO_PREVIEW_LENGTH is the length in ms for how long is the captured image shown.