The way to freeze the camera preview

喜夏-厌秋 提交于 2019-12-11 08:37:15

问题


I Implemented a system to take photo in my apps with Android class Camera. All run well but after taken photo I want show the preview at the user and let him the choice to save the picture or cancel it. The problem I have is with the preview. The preview appears after the mCamera.startPreview(); and is shown during only some little seconds with or without mCamera.stopPreview();. I would extend display time or freeze preview until some certain event.

Somebody know a way to congeal the preview for a time ?

Thanks.


回答1:


you will need to fetch the image taken and display it.




回答2:


The preview will be stopped after you take a picture. However, the stopped preview does not necessarily correspond to the picture that was actually taken. For that, you'll have to fetch the picture and display it through an ImageView or something similar.

http://developer.android.com/reference/android/hardware/Camera.html#takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback)

This method is only valid when preview is active (after startPreview()). Preview will be stopped after the image is taken; callers must call startPreview() again if they want to re-start preview or take more pictures. This should not be called between start() and stop(). After calling this method, you must not call startPreview() or take another picture until the JPEG callback has returned.



来源:https://stackoverflow.com/questions/8304277/the-way-to-freeze-the-camera-preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!