在Android的图像捕捉自动 [英] Image capture in Android automatically

查看:99
本文介绍了在Android的图像捕捉自动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法可以使用​​下面的code拍照自动也就是说没有按钮的点击可言。就在此前一段时间的图像可自动拍摄并存储在SD卡上。

 保护无效startCameraActivity(){

    意向意图=新的意图(MediaStore.ACTION_IM​​AGE_CAPTURE);
    intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(新文件(FILE_NAME)));
    startActivityForResult(意向,1);
    完();
}
 

解决方案

没有,一旦你开始一个Intent你真的有过在启动活动没有控制权(假设它不是一个你自己写)。你的情况,你必须使自己的活动,并使用照相机API。

看看这个教程:

http://marakana.com/forums/android/examples/39.html

Is there any way to use the following code to take pictures automatically i.e. no button clicks at all. Just after sometime image can be taken automatically and stored on the SD card.

protected void startCameraActivity() {

    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(new File(file_name)));
    startActivityForResult(intent, 1);
    finish();
}

解决方案

No, once you start an Intent you really have no control over the Activity you start (assuming it's not one that you wrote yourself). In your case, you have to make your own Activity and use the Camera API.

Check out this tutorial:

http://marakana.com/forums/android/examples/39.html

这篇关于在Android的图像捕捉自动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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