take camera picture with ACTION_IMAGE_CAPTURE


  1. android88

    android88 Member

    Hi everyone, I just found out that there is a standard camera intent and I want to use it to take a picture in my application. I'm calling the picture taking intent like this:

    Code (Text):
    1. Intent intent2= new Intent("android.media.action.IMAGE_CAPTURE");
    2. uri = Uri.fromFile(new File("TempPicture"));
    3. intent2.putExtra(MediaStore.EXTRA_OUTPUT,uri);
    4. startActivityForResult(intent2,0);
    And in the onActivityresult:
    Code (Text):
    1.  
    2. Bitmap leftImage = (Bitmap)data.getExtras().get("data");
    But the image doesn't get the filename I specify (TempPicture), but just a numbered filename (e.g. "IMAG0119"). Also, the line above for getting the bitmap doesn't get the real image, but a very scaled down version (the image that gets stored on my sd card is much bigger).

    Does anyone know how to get it to make the file with my own filename? The reason I want to know this is because I don't actually want to save the image on the phone, I just want to read it in an other part of my application and then delete it. But for deleting it I need the filename.

    PS: Is it true that I can't get a full sized image when using the standard camera intent? (The images I get are about 600x400, and by googling it seems like fullsized images are not possible)

    Advertisement
Loading...

Share This Page