拍摄的照片从正面和背面摄像头同时 [英] capture photo from both front and back camera simultaneously

查看:434
本文介绍了拍摄的照片从正面和背面摄像头同时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个Android应用程序有捕捉从相机中的照片(正面和背面)在simultaneously.I搜查了互联网的技术,但遗憾的是我没有找到任何更好的解决方案。

I would like to develop an Android application which has the technique of capturing a photo from camera(both front and back) at simultaneously.I searched over internet but unfortunately I couldn't find any better solution.

注意例如,如果我捕捉回来的摄像头,照片一旦从后拍摄的手段那么它会自动启动前置摄像头用于拍摄照片。

note for example if I capture the photo from back camera,once it captured from back means then it has to start front camera automatically for capture a photo.

推荐答案

您需要解决这个问题一步一步来。

You need to approach this problem step by step.

  1. 先建功能拍摄照片通过相机背面。
  2. 一旦你这样做,然后建立功能通过前置摄像头进行拍照(大部分code将是相同的,只是把背面/ FONT相机会有所不同。
  3. 一旦这两个选项建,单独,那么你可以通过它的三个步骤结合两种:1)拍摄照片通过相机背面2)将相机切换到前3)前置摄像头拍摄照片。

再次如前所述,拍照由背面和正面相机不不同,它仅涉及切换的摄像机。

Again, as mentioned, taking picture by back and front cameras are not different, it only involves switching the cameras.

看到新评论后编辑:

如果您使用的是内置摄像头,正在使用的意图,那么这个任务不会是一个自动直接的事情。我还以为你建立自定义的摄像头,在那里你可以通过code做了这一切(无意图和内置摄像头)。但不管怎么说,你仍然可以做到这一点。

If you are using the built-in camera, that is using intents, then this task is not going to be an automatic and immediate thing. I thought you were building custom camera, where you can do all this by code (without intents and built-in camera). But anyways, you can still do it.

所以,现在,这个过程将是:

So now, the process will be:

  1. 使用意图去照相机。
  2. 在拍摄照片(默认情况下是相机背面)。做你 想与这个画面,保存,加工等。
  3. 使用另一个意图去照相机了。这一次,增加额外的到你的意图,所以相机默认为前置摄像头 intent.putExtra(android.intent.extras.CAMERA_FACING,1);

  1. Use intent to go to Camera.
  2. Take a picture (which is by default back camera). Do whatever you want to do with this picture, save, process, etc.
  3. Use another intent to go to Camera again. This time, add an extra to your intent to so the camera defaults to front camera intent.putExtra("android.intent.extras.CAMERA_FACING", 1);

再次拍摄照片。

请参阅本线程如何启动前置摄像头意图: 如何启动前置摄像头意图?

Refer to this thread for how to launch front camera with intent: How to launch front camera with intent?

这篇关于拍摄的照片从正面和背面摄像头同时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆