Come ottenere bitmap a grandezza naturale dalla fotocamera?
-
13-12-2019 - |
Domanda
Ho usato l'intenzione di lanciare la fotocamera
Intent cameraIntent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
getParent().startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
.
e OnottivitàResult () Usato
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
Save_to_SD (thumbnail, filename);
.
Ma ottieni miniature erano piccole dimensioni, come faccio a ottenere la bitmap completa?
Soluzione
Salva l'uscita su alcuni URI e ottieni da lì
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
mImageCaptureUri1 = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
"tmp_avatar_" + String.valueOf(System.currentTimeMillis()) + ".jpg"));
cameraIntent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri1);
cameraIntent.putExtra("return-data", true);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow