Bonjour,j'essaye de récupérer un path d'une uri afin de l'avoir dans une Bitmap.
Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 Uri taken = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values); stream = (FileOutputStream) getContentResolver().openOutputStream( taken); Intent intentPicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intentPicture.putExtra(MediaStore.EXTRA_OUTPUT, taken); String path = getRealPathFromURI(taken); BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; Bitmap monImage = BitmapFactory.decodeFile(path, options); camera.takePicture(null, pictureCallback, pictureCallback);
Mais l'image ne se charge pas.
Merci d'avance.
Partager