Is there an Image cropping Activity in Android? I know that when you save an images as your wallpaper, it pops up an image cropper… and I’ve looked into the sourcecode for that, but it depends on a LOT of gallery specific stuff. Not very reusable.
Does anyone know how this might be done, or are there any third party libraries that can help me out on this one?
There’s a reasonably well-supported Intent for this (worked on my testing on at least a half dozen different Android 2.1+ phones, including SenseUI and Motoblur devices, and I believe it’s been around since Android 1.0 or earlier on the G1). This might get you started:
Then just handle what you need to do in the onActivityResult() method of your Activity; your output file should have the cropped image in it at that point.
NOTE: This code makes use of an internal API and will not work on all devices. To be safe, though, you may want to have a fallback behavior (autocrop? Don’t crop?) if someone has a device that doesn’t support this Intent.