public class UCrop
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UCrop.Options
Class that helps to setup advanced configs that are not commonly used.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXTRA_ASPECT_RATIO_X |
static java.lang.String |
EXTRA_ASPECT_RATIO_Y |
static java.lang.String |
EXTRA_ERROR |
static java.lang.String |
EXTRA_INPUT_URI |
static java.lang.String |
EXTRA_MAX_SIZE_X |
static java.lang.String |
EXTRA_MAX_SIZE_Y |
static java.lang.String |
EXTRA_OUTPUT_CROP_ASPECT_RATIO |
static java.lang.String |
EXTRA_OUTPUT_IMAGE_HEIGHT |
static java.lang.String |
EXTRA_OUTPUT_IMAGE_WIDTH |
static java.lang.String |
EXTRA_OUTPUT_OFFSET_X |
static java.lang.String |
EXTRA_OUTPUT_OFFSET_Y |
static java.lang.String |
EXTRA_OUTPUT_URI |
static int |
REQUEST_CROP |
static int |
RESULT_ERROR |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Throwable |
getError(android.content.Intent result)
Method retrieves error from the result intent.
|
android.content.Intent |
getIntent(android.content.Context context)
Get Intent to start
UCropActivity |
static android.net.Uri |
getOutput(android.content.Intent intent)
Retrieve cropped image Uri from the result Intent
|
static float |
getOutputCropAspectRatio(android.content.Intent intent)
Retrieve cropped image aspect ratio from the result Intent
|
static int |
getOutputImageHeight(android.content.Intent intent)
Retrieve the height of the cropped image
|
static int |
getOutputImageWidth(android.content.Intent intent)
Retrieve the width of the cropped image
|
static UCrop |
of(android.net.Uri source,
android.net.Uri destination)
This method creates new Intent builder and sets both source and destination image URIs.
|
void |
start(android.app.Activity activity)
Send the crop Intent from an Activity
|
void |
start(android.app.Activity activity,
int requestCode)
Send the crop Intent from an Activity with a custom request code
|
void |
start(android.content.Context context,
android.support.v4.app.Fragment fragment)
Send the crop Intent from a support library Fragment
|
void |
start(android.content.Context context,
android.support.v4.app.Fragment fragment,
int requestCode)
Send the crop Intent with a custom request code
|
void |
start(android.content.Context context,
android.app.Fragment fragment)
Send the crop Intent from a Fragment
|
void |
start(android.content.Context context,
android.app.Fragment fragment,
int requestCode)
Send the crop Intent with a custom request code
|
UCrop |
useSourceImageAspectRatio()
Set an aspect ratio for crop bounds that is evaluated from source image width and height.
|
UCrop |
withAspectRatio(float x,
float y)
Set an aspect ratio for crop bounds.
|
UCrop |
withMaxResultSize(int width,
int height)
Set maximum size for result cropped image.
|
UCrop |
withOptions(UCrop.Options options) |
public static final int REQUEST_CROP
public static final int RESULT_ERROR
public static final java.lang.String EXTRA_INPUT_URI
public static final java.lang.String EXTRA_OUTPUT_URI
public static final java.lang.String EXTRA_OUTPUT_CROP_ASPECT_RATIO
public static final java.lang.String EXTRA_OUTPUT_IMAGE_WIDTH
public static final java.lang.String EXTRA_OUTPUT_IMAGE_HEIGHT
public static final java.lang.String EXTRA_OUTPUT_OFFSET_X
public static final java.lang.String EXTRA_OUTPUT_OFFSET_Y
public static final java.lang.String EXTRA_ERROR
public static final java.lang.String EXTRA_ASPECT_RATIO_X
public static final java.lang.String EXTRA_ASPECT_RATIO_Y
public static final java.lang.String EXTRA_MAX_SIZE_X
public static final java.lang.String EXTRA_MAX_SIZE_Y
public static UCrop of(android.net.Uri source, android.net.Uri destination)
source - Uri for image to cropdestination - Uri for saving the cropped imagepublic UCrop withAspectRatio(float x, float y)
x - aspect ratio Xy - aspect ratio Ypublic UCrop useSourceImageAspectRatio()
public UCrop withMaxResultSize(int width, int height)
width - max cropped image widthheight - max cropped image heightpublic UCrop withOptions(UCrop.Options options)
public void start(android.app.Activity activity)
activity - Activity to receive resultpublic void start(android.app.Activity activity,
int requestCode)
activity - Activity to receive resultrequestCode - requestCode for resultpublic void start(android.content.Context context,
android.app.Fragment fragment)
fragment - Fragment to receive resultpublic void start(android.content.Context context,
android.support.v4.app.Fragment fragment)
fragment - Fragment to receive resultpublic void start(android.content.Context context,
android.app.Fragment fragment,
int requestCode)
fragment - Fragment to receive resultrequestCode - requestCode for resultpublic void start(android.content.Context context,
android.support.v4.app.Fragment fragment,
int requestCode)
fragment - Fragment to receive resultrequestCode - requestCode for resultpublic android.content.Intent getIntent(android.content.Context context)
UCropActivityUCropActivitypublic static android.net.Uri getOutput(android.content.Intent intent)
intent - crop result intentpublic static int getOutputImageWidth(android.content.Intent intent)
intent - crop result intentpublic static int getOutputImageHeight(android.content.Intent intent)
intent - crop result intentpublic static float getOutputCropAspectRatio(android.content.Intent intent)
intent - crop result intentpublic static java.lang.Throwable getError(android.content.Intent result)
result - crop result Intent