Class Crop
- java.lang.Object
-
- com.cloudinary.android.preprocess.Crop
-
- All Implemented Interfaces:
com.cloudinary.android.preprocess.Preprocess<android.graphics.Bitmap>
public class Crop extends java.lang.Object implements com.cloudinary.android.preprocess.Preprocess<android.graphics.Bitmap>Preprocess for cropping. Send an instance toPreprocessChain.addStep(Preprocess)to crop an image. Points must form a diagonal within the bounds of the image. If the points form the same diagonal size as the original image, it will be returned unchanged.
-
-
Constructor Summary
Constructors Constructor Description Crop(android.graphics.Point p1, android.graphics.Point p2)Create a new crop preprocess.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.graphics.Bitmapexecute(android.content.Context context, android.graphics.Bitmap resource)Execute the preprocessing phase.
-
-
-
Method Detail
-
execute
public android.graphics.Bitmap execute(android.content.Context context, android.graphics.Bitmap resource) throws com.cloudinary.android.preprocess.PreprocessExceptionExecute the preprocessing phase. This will crop the image if needed, making sure that the points form a diagonal within the bounds of the bitmap.- Specified by:
executein interfacecom.cloudinary.android.preprocess.Preprocess<android.graphics.Bitmap>- Parameters:
context- Android contextresource- The Bitmap to crop- Returns:
- The cropped bitmap (or the original bitmap if the points form the same diagonal size).
- Throws:
com.cloudinary.android.preprocess.PreprocessException
-
-