-
public class CropImageHelper to simplify crop image work like starting pick-image activity and handling camera/gallery intents.<br></br> The goal of the helper is to simplify the starting and most-common usage of image cropping and not all-purpose all possible scenario one-to-rule-them-all code base. So feel free to use it as is and as a wiki to make your own.<br></br> Added value you get out-of-the-box is some edge case handling that you may miss otherwise, like the stupid-ass Android camera result URI that may differ from version to version and from device to device.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classCropImage.ActivityResultResult data of Crop Image Activity.
public classCropImage.CancelledResult
-
Field Summary
Fields Modifier and Type Field Description private final StringCROP_IMAGE_EXTRA_SOURCEprivate final StringCROP_IMAGE_EXTRA_OPTIONSprivate final StringCROP_IMAGE_EXTRA_BUNDLEprivate final StringCROP_IMAGE_EXTRA_RESULTprivate final IntegerCROP_IMAGE_ACTIVITY_RESULT_ERROR_CODEpublic final static CropImageINSTANCE
-
Method Summary
Modifier and Type Method Description final BitmaptoOvalBitmap(Bitmap bitmap)Create a new bitmap that has all pixels beyond the oval shape transparent. final StringgetCROP_IMAGE_EXTRA_SOURCE()The key used to pass crop image source URI to CropImageActivity. final StringgetCROP_IMAGE_EXTRA_OPTIONS()The key used to pass crop image options to CropImageActivity. final StringgetCROP_IMAGE_EXTRA_BUNDLE()The key used to pass crop image bundle data to CropImageActivity. final StringgetCROP_IMAGE_EXTRA_RESULT()The key used to pass crop image result data back from CropImageActivity. final IntegergetCROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE()The result code used to return error from CropImageActivity. -
-
Method Detail
-
toOvalBitmap
final Bitmap toOvalBitmap(Bitmap bitmap)
Create a new bitmap that has all pixels beyond the oval shape transparent. Old bitmap is recycled.
-
getCROP_IMAGE_EXTRA_SOURCE
final String getCROP_IMAGE_EXTRA_SOURCE()
The key used to pass crop image source URI to CropImageActivity.
-
getCROP_IMAGE_EXTRA_OPTIONS
final String getCROP_IMAGE_EXTRA_OPTIONS()
The key used to pass crop image options to CropImageActivity.
-
getCROP_IMAGE_EXTRA_BUNDLE
final String getCROP_IMAGE_EXTRA_BUNDLE()
The key used to pass crop image bundle data to CropImageActivity.
-
getCROP_IMAGE_EXTRA_RESULT
final String getCROP_IMAGE_EXTRA_RESULT()
The key used to pass crop image result data back from CropImageActivity.
-
getCROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE
final Integer getCROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE()
The result code used to return error from CropImageActivity.
-
-
-
-