Package 

Class CropWindowHandler


  • 
    public final class CropWindowHandler
    
                        

    Handler from crop window stuff, moving and knowing position.

    • Method Summary

      Modifier and Type Method Description
      final RectF getRect() 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 Float getScaleFactorWidth() get the scale factor (on width) of the shown image to original image.
      final Float getScaleFactorHeight() get the scale factor (on height) of the shown image to original image.
      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).
      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).
      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.
      final Unit setInitialAttributeValues(CropImageOptions options) Set the variables to be used during crop window handling.
      final Unit setRect(RectF rect) Set the left/top/right/bottom coordinates of the crop window.
      final Boolean showGuidelines() Indicates whether the crop window is small enough that the guidelines should be shown.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CropWindowHandler

        CropWindowHandler()
    • Method Detail

      • getRect

         final RectF getRect()

        Get the left/top/right/bottom coordinates of the crop window.

      • 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.

      • 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 point
        y - the y-coordinate of the touch point
        targetRadius - the target radius in pixels
        cropShape - the shape of the crop window
        isCenterMoveEnabled - whether movement of the crop window by dragging center is enabled