如何获取相机拍摄的原始图像的路径或uri。
How to get the path or uri of the original Image captured by the camera.
如何获取摄像头拍摄的原始Image的路径或uri。
当我使用下面的代码时,它 returns 我是 google 文档中提到的原始图像的缩略图。
我要原图的路径或uri。
我使用了以下代码,但它 returns 是一个缩略图。
Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
// CALL THIS METHOD TO GET THE URI FROM THE BITMAP
Uri tempUri = getImageUri(getApplicationContext(), imageBitmap);
// CALL THIS METHOD TO GET THE ACTUAL PATH
File finalFile = new File(getRealPathFromURI(tempUri));
Intent intent = new Intent(IdentifyActivity.this, detailedActivity.class);
intent.putExtra("PATH", finalFile.getPath());
startActivity(intent);
您没有显示您使用的 Intent
。我假设它是 ACTION_IMAGE_CAPTURE
.
How to get the path or uri of the original Image captured by the camera
你不需要,除非你提供 Uri
以通过 EXTRA_OUTPUT
使用。
when i use the following code it returns me the thumbnail image
如果你不提供EXTRA_OUTPUT
,ACTION_IMAGE_CAPTURE
应该给你一个缩略图。
I have already tried this method you said... it gives an error
那么也许你应该问一个单独的 Stack Overflow 问题,在其中提供你使用的代码并详细解释问题所在。 This sample app 演示了 ACTION_IMAGE_CAPTURE
与 EXTRA_OUTPUT
的用法。
there is original image in the gallery
大约有 20 亿 Android 台设备,分布在大约 10,000 种设备型号中。有数十种(如果不是数百种)预装相机应用程序。用户可以从 Play 商店和其他地方安装数十种(如果不是数百种)额外的相机应用程序。 您的请求可以由它们中的任何一个处理,所以不要假设一个相机应用程序的行为与所有应用程序的行为相同。
当第三方应用程序 ACTION_IMAGE_CAPTURE
请求缩略图时,相机应用程序无需将全尺寸图像写入磁盘。事实上,如果他们 在那种情况下写出全尺寸图像,我会认为这是一个错误。
如何获取摄像头拍摄的原始Image的路径或uri。 当我使用下面的代码时,它 returns 我是 google 文档中提到的原始图像的缩略图。 我要原图的路径或uri。
我使用了以下代码,但它 returns 是一个缩略图。
Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
// CALL THIS METHOD TO GET THE URI FROM THE BITMAP
Uri tempUri = getImageUri(getApplicationContext(), imageBitmap);
// CALL THIS METHOD TO GET THE ACTUAL PATH
File finalFile = new File(getRealPathFromURI(tempUri));
Intent intent = new Intent(IdentifyActivity.this, detailedActivity.class);
intent.putExtra("PATH", finalFile.getPath());
startActivity(intent);
您没有显示您使用的 Intent
。我假设它是 ACTION_IMAGE_CAPTURE
.
How to get the path or uri of the original Image captured by the camera
你不需要,除非你提供 Uri
以通过 EXTRA_OUTPUT
使用。
when i use the following code it returns me the thumbnail image
如果你不提供EXTRA_OUTPUT
,ACTION_IMAGE_CAPTURE
应该给你一个缩略图。
I have already tried this method you said... it gives an error
那么也许你应该问一个单独的 Stack Overflow 问题,在其中提供你使用的代码并详细解释问题所在。 This sample app 演示了 ACTION_IMAGE_CAPTURE
与 EXTRA_OUTPUT
的用法。
there is original image in the gallery
大约有 20 亿 Android 台设备,分布在大约 10,000 种设备型号中。有数十种(如果不是数百种)预装相机应用程序。用户可以从 Play 商店和其他地方安装数十种(如果不是数百种)额外的相机应用程序。 您的请求可以由它们中的任何一个处理,所以不要假设一个相机应用程序的行为与所有应用程序的行为相同。
当第三方应用程序 ACTION_IMAGE_CAPTURE
请求缩略图时,相机应用程序无需将全尺寸图像写入磁盘。事实上,如果他们 在那种情况下写出全尺寸图像,我会认为这是一个错误。