-
public final class CropWindowHandlerHandler from crop window stuff, moving and knowing position.
-
-
Constructor Summary
Constructors Constructor Description CropWindowHandler()
-
Method Summary
Modifier and Type Method Description final RectFgetRect()Get the left/top/right/bottom coordinates of the crop window. final <ERROR CLASS>getMinCropWidth()Minimum width in pixels that the crop window can get. final <ERROR CLASS>getMinCropHeight()Minimum height in pixels that the crop window can get. final <ERROR CLASS>getMaxCropWidth()Maximum width in pixels that the crop window can get. final <ERROR CLASS>getMaxCropHeight()Maximum height in pixels that the crop window can get. final FloatgetScaleFactorWidth()get the scale factor (on width) of the shown image to original image. final FloatgetScaleFactorHeight()get the scale factor (on height) of the shown image to original image. final UnitsetMinCropResultSize(Integer minCropResultWidth, Integer minCropResultHeight)the min size the resulting cropping image is allowed to be, affects the cropping window limits (in pixels). final UnitsetMaxCropResultSize(Integer maxCropResultWidth, Integer maxCropResultHeight)the max size the resulting cropping image is allowed to be, affects the cropping window limits (in pixels). final UnitsetCropWindowLimits(Float maxWidth, Float maxHeight, Float scaleFactorWidth, Float scaleFactorHeight)set the max width/height and scale factor of the shown image to original image to scale the limits appropriately. final UnitsetInitialAttributeValues(CropImageOptions options)Set the variables to be used during crop window handling. final UnitsetRect(RectF rect)Set the left/top/right/bottom coordinates of the crop window. final BooleanshowGuidelines()Indicates whether the crop window is small enough that the guidelines should be shown. final CropWindowMoveHandlergetMoveHandler(Float x, Float y, Float targetRadius, CropImageView.CropShape cropShape, Boolean isCenterMoveEnabled)Determines which, if any, of the handles are pressed given the touch coordinates, the bounding box, the touch radius, the crop shape and whether movement of the crop window is enabled. -
-
Method Detail
-
getMinCropWidth
final <ERROR CLASS> getMinCropWidth()
Minimum width in pixels that the crop window can get.
-
getMinCropHeight
final <ERROR CLASS> getMinCropHeight()
Minimum height in pixels that the crop window can get.
-
getMaxCropWidth
final <ERROR CLASS> getMaxCropWidth()
Maximum width in pixels that the crop window can get.
-
getMaxCropHeight
final <ERROR CLASS> getMaxCropHeight()
Maximum height in pixels that the crop window can get.
-
getScaleFactorWidth
final Float getScaleFactorWidth()
get the scale factor (on width) of the shown image to original image.
-
getScaleFactorHeight
final Float getScaleFactorHeight()
get the scale factor (on height) of the shown image to original image.
-
setMinCropResultSize
final Unit setMinCropResultSize(Integer minCropResultWidth, Integer minCropResultHeight)
the min size the resulting cropping image is allowed to be, affects the cropping window limits (in pixels).<br></br>
-
setMaxCropResultSize
final Unit setMaxCropResultSize(Integer maxCropResultWidth, Integer maxCropResultHeight)
the max size the resulting cropping image is allowed to be, affects the cropping window limits (in pixels).<br></br>
-
setCropWindowLimits
final Unit setCropWindowLimits(Float maxWidth, Float maxHeight, Float scaleFactorWidth, Float scaleFactorHeight)
set the max width/height and scale factor of the shown image to original image to scale the limits appropriately.
-
setInitialAttributeValues
final Unit setInitialAttributeValues(CropImageOptions options)
Set the variables to be used during crop window handling.
-
setRect
final Unit setRect(RectF rect)
Set the left/top/right/bottom coordinates of the crop window.
-
showGuidelines
final Boolean showGuidelines()
Indicates whether the crop window is small enough that the guidelines should be shown. Public because this function is also used to determine if the center handle should be focused.
-
getMoveHandler
final CropWindowMoveHandler getMoveHandler(Float x, Float y, Float targetRadius, CropImageView.CropShape cropShape, Boolean isCenterMoveEnabled)
Determines which, if any, of the handles are pressed given the touch coordinates, the bounding box, the touch radius, the crop shape and whether movement of the crop window is enabled.
- Parameters:
x- the x-coordinate of the touch pointy- the y-coordinate of the touch pointtargetRadius- the target radius in pixelscropShape- the shape of the crop windowisCenterMoveEnabled- whether movement of the crop window by dragging center is enabled
-
-
-
-