Class Limit
- java.lang.Object
-
- com.cloudinary.android.preprocess.Limit
-
- All Implemented Interfaces:
com.cloudinary.android.preprocess.Preprocess<android.graphics.Bitmap>
public class Limit extends java.lang.Object implements com.cloudinary.android.preprocess.Preprocess<android.graphics.Bitmap>Preprocess implementation for resizing. Send an instance toPreprocessChain.addStep(Preprocess)to scale down any image larger thenheight/width. The scaling retains aspect ratio while making sure the height and width are within the requested maximum bounds. If the original image is smaller thanheightandwidth, it will be returned unchanged.
-
-
Constructor Summary
Constructors Constructor Description Limit(int width, int height)Create a new Resize 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)Execute the preprocessing phase. This will check the dimensions and scale down the image if needed, making sure both height and width are within maximum bounds.- Specified by:
executein interfacecom.cloudinary.android.preprocess.Preprocess<android.graphics.Bitmap>- Parameters:
context- Android contextresource- The Bitmap to resize- Returns:
- The scaled down bitmap (or the original bitmap if it's within bounds).
-
-