public class

PTCropImageViewBase

extends AppCompatImageView
java.lang.Object
   ↳ androidx.appcompat.widget.AppCompatImageView
     ↳ com.pdftron.pdf.widget.PTCropImageViewBase
Known Direct Subclasses

Summary

Nested Classes
interface PTCropImageViewBase.PTCropImageViewListener  
Constants
int GUIDELINES_OFF
int GUIDELINES_ON
int GUIDELINES_ON_TOUCH
Public Constructors
PTCropImageViewBase(Context context)
PTCropImageViewBase(Context context, AttributeSet attrs)
PTCropImageViewBase(Context context, AttributeSet attrs, int defStyleAttr)
Public Methods
Bitmap getCroppedImage()
Gets the cropped image based on the current crop window.
boolean onTouchEvent(MotionEvent event)
void setAspectRatio(int aspectRatioX, int aspectRatioY)
Sets the both the X and Y values of the aspectRatio.
void setFixedAspectRatio(boolean fixAspectRatio)
Sets whether the aspect ratio is fixed or not; true fixes the aspect ratio, while false allows it to be changed.
void setGuidelines(int guidelinesMode)
Sets the guidelines for the CropOverlayView to be either on, off, or to show when resizing the application.
void setPTCropImageViewListener(PTCropImageViewBase.PTCropImageViewListener listener)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int GUIDELINES_OFF

Constant Value: 0 (0x00000000)

public static final int GUIDELINES_ON

Constant Value: 2 (0x00000002)

public static final int GUIDELINES_ON_TOUCH

Constant Value: 1 (0x00000001)

Public Constructors

public PTCropImageViewBase (Context context)

public PTCropImageViewBase (Context context, AttributeSet attrs)

public PTCropImageViewBase (Context context, AttributeSet attrs, int defStyleAttr)

Public Methods

public Bitmap getCroppedImage ()

Gets the cropped image based on the current crop window.

Returns
  • a new Bitmap representing the cropped image

public boolean onTouchEvent (MotionEvent event)

public void setAspectRatio (int aspectRatioX, int aspectRatioY)

Sets the both the X and Y values of the aspectRatio. These only apply iff fixed aspect ratio is set.

Parameters
aspectRatioX new X value of the aspect ratio; must be greater than 0
aspectRatioY new Y value of the aspect ratio; must be greater than 0
See Also
  • {@link #setFixedAspectRatio(boolean)}

public void setFixedAspectRatio (boolean fixAspectRatio)

Sets whether the aspect ratio is fixed or not; true fixes the aspect ratio, while false allows it to be changed.

Parameters
fixAspectRatio Boolean that signals whether the aspect ratio should be maintained.
See Also
  • {@link #setAspectRatio(int, int)}

public void setGuidelines (int guidelinesMode)

Sets the guidelines for the CropOverlayView to be either on, off, or to show when resizing the application.

Parameters
guidelinesMode Integer that signals whether the guidelines should be on, off, or only showing when resizing.

public void setPTCropImageViewListener (PTCropImageViewBase.PTCropImageViewListener listener)