如何控制/保存图像带着摄像头的Andr​​oid编程? [英] how to control/save images took with android camera programmatically?

查看:131
本文介绍了如何控制/保存图像带着摄像头的Andr​​oid编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图建立一个相机相关的应用程序。我知道我可以编程方式从顶部创建它,但我会用一个preFER手机支持。

i've been trying to create a camera-related app. i know that i could create it programmatically from top, but i would prefer using the one that the phone supports.

我的意思是,而不是从0创建相机,我会/可以调用摄像头的活动。毕竟,它提供了所有的系统和图形用户界面,我需要的。

what i mean is, rather then creating the camera from 0, i would/could call the camera activity. after all, it provides all the system and gui that i needed.

然而,问题是我想要的结果/图像走上得救,我之前创建的,而不是将其保存在默认照片文件夹的文件夹。并且还重命名了图像从默认的图像那一瞬间,我preferred名。

however, the problem is i wanted the result/image took to be saved in a folder that i created before, rather then saving it in the default camera folder. and also renaming the image took that instant from the default 'image' to names that i preferred.

我怎么控制?

推荐答案

试试这个。我在这里保存图片 SD卡,并更改其名称,同时节省。

Try this. Here am saving picture to sdcard and also changing its name while saving.

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

Uri mUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
                "pic"+ String.valueOf(System.currentTimeMillis()) + ".jpg"));

intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mUri);

这篇关于如何控制/保存图像带着摄像头的Andr​​oid编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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