I've figured out how to get the camera to work. It's taking a 1/4
resolution picture and I'm putting it into the gallary. Next, I want
to create a small icon of that picture to put on a button. I've seen
several examples and the code below is what I've been trying:

                showMessage("Next Step is cropping - Waiting ...");
                logDebug("Sending URI " + mOutputFileUri);

                // now we want to grab a lower res version for the button.
                Intent cropIntent = new 
Intent("com.android.camera.action.CROP");
                cropIntent.setClassName
("com.android.camera","com.android.camera.CropImage");
                cropIntent.setData(mOutputFileUri);
                //cropIntent.setData(intent.getData());
                cropIntent.putExtra("noFaceDetection", true);
                cropIntent.putExtra("outputX", ICON_SIZE);
                cropIntent.putExtra("outputY", ICON_SIZE);
                cropIntent.putExtra("aspectX", 1);
                cropIntent.putExtra("aspectY", 1);
                cropIntent.putExtra("scale", true);
                cropIntent.putExtra("return-data", true);
                startActivityForResult(cropIntent, CROP_FROM_CAMERA);

But, this blows up with a null pointer exception. I also get a warning
in the log message stream saying the image file isn't finished
writing.

I've based my code on this:
http://stackoverflow.com/questions/1973359/android-crop-an-image-after-taking-it-with-camera-with-a-fixed-aspect-ratio

Also, when it tries to delete the temporary file, there is an error
because I don't have permission.

This smells like I'm just missing something important. Can anyone
point me in the right direction?

Is there any other way to get an icon of the image?

Thanks,
  Ray
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to