public class CropTransformation
extends java.lang.Object
implements com.squareup.picasso.Transformation
| Modifier and Type | Class and Description |
|---|---|
static class |
CropTransformation.GravityHorizontal |
static class |
CropTransformation.GravityVertical |
| Constructor and Description |
|---|
CropTransformation(float aspectRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
Crops to the largest image that will fit the given aspectRatio.
|
CropTransformation(float widthRatio,
float heightRatio)
Crops to a ratio of the source image's width/height, defaulting to CENTER/CENTER gravity.
|
CropTransformation(float widthRatio,
float heightRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
Crops to a ratio of the source image's width/height.
|
CropTransformation(float widthRatio,
float heightRatio,
float aspectRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
Crops to the desired aspectRatio driven by either width OR height as a ratio to the original
image's dimension.
|
CropTransformation(int width,
int height)
Crops to the given width and height (in pixels), defaulting gravity to CENTER/CENTER.
|
CropTransformation(int width,
int height,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
Crops to the given width and height (in pixels) using the given gravity.
|
CropTransformation(int width,
int height,
float aspectRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
Crops to the desired aspectRatio driven by either width OR height in pixels.
|
CropTransformation(int left,
int top,
int width,
int height)
Crops to the given size and offset in pixels.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
key() |
android.graphics.Bitmap |
transform(android.graphics.Bitmap source) |
public CropTransformation(int left,
int top,
int width,
int height)
left - offset in pixels from the left edge of the source imagetop - offset in pixels from the top of the source imagewidth - in pixelsheight - in pixelspublic CropTransformation(int width,
int height,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
width - in pixelsheight - in pixelsgravityHorizontal - position of the cropped area within the larger source imagegravityVertical - position of the cropped area within the larger source imagepublic CropTransformation(int width,
int height)
width - in pixelsheight - in pixelspublic CropTransformation(float widthRatio,
float heightRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
widthRatio - width of the target image relative to the width of the source image; 1 =
100%heightRatio - height of the target image relative to the height of the source image; 1 =
100%gravityHorizontal - position of the cropped area within the larger source imagegravityVertical - position of the cropped area within the larger source imagepublic CropTransformation(float widthRatio,
float heightRatio)
widthRatio - width of the target image relative to the width of the source image; 1 =
100%heightRatio - height of the target image relative to the height of the source image; 1 =
100%public CropTransformation(int width,
int height,
float aspectRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
width - in pixels, one of width/height should be zeroheight - in pixels, one of width/height should be zeroaspectRatio - width/height: greater than 1 is landscape, less than 1 is portrait, 1 is
squaregravityHorizontal - position of the cropped area within the larger source imagegravityVertical - position of the cropped area within the larger source imagepublic CropTransformation(float widthRatio,
float heightRatio,
float aspectRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
widthRatio - width of the target image relative to the width of the source image; 1 =
100%heightRatio - height of the target image relative to the height of the source image; 1 =
100%aspectRatio - width/height: greater than 1 is landscape, less than 1 is portrait, 1 is
squaregravityHorizontal - position of the cropped area within the larger source imagegravityVertical - position of the cropped area within the larger source imagepublic CropTransformation(float aspectRatio,
CropTransformation.GravityHorizontal gravityHorizontal,
CropTransformation.GravityVertical gravityVertical)
aspectRatio - width/height: greater than 1 is landscape, less than 1 is portrait, 1 is
squaregravityHorizontal - position of the cropped area within the larger source imagegravityVertical - position of the cropped area within the larger source image