Android的我在哪里可以得到母语相机应用拍摄的图像 [英] Android where can I get image taken by native camera app
本文介绍了Android的我在哪里可以得到母语相机应用拍摄的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的原生相机应用捕获图像,而且我没有使用MediaStore.EXTRA_OUTPUT指定图片的路径。然后,我怎样才能使用意图的形象。
I am using native camera app to capture image, And I am not using MediaStore.EXTRA_OUTPUT to specify the path of image. Then how can i get the image using the intent.
感谢。
推荐答案
要拍摄使用相机调用此意图的图像
To capture images using camera call this intent
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, requestCode);
和处理使用回调函数的onActivityResult
and to handle the callback use onActivityResult function
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Bitmap mImageBitmap;
Bundle extras = data.getExtras();
mImageBitmap = Bitmap.createScaledBitmap(
(Bitmap) extras.get("data"), 100, 100, false);
}
mImageBitmap会认为你拍摄的图像。希望它可以帮助:)
mImageBitmap will hold the image that you captured. Hope it helps :)
这篇关于Android的我在哪里可以得到母语相机应用拍摄的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文