CropAndStraightenView
@objc(PESDKCropAndStraightenView) open class CropAndStraightenView: UIView
The CropAndStraightenView
class provides support for displaying, zooming, rotating and
cropping an image.
-
The delegate of the
CropAndStraightenView
object.Declaration
Swift
open weak var delegate: CropAndStraightenViewDelegate?
-
The image that is to be displayed.
Declaration
Swift
open var image: UIImage?
-
The straighten angle to apply to the image in radians.
Declaration
Swift
open var straightenAngle: CGFloat = 0
-
The crop rect to apply to the image. This should be a normalized
CGRect
.Declaration
Swift
open var cropRect: CGRect = .zero
-
The orientation to apply to the image.
Declaration
Swift
open var orientation: Orientation = .normal
-
The crop rect in image dimensions.
Declaration
Swift
open var imageCropRect: CGRect
-
Converts a view rect to image dimensions.
Declaration
Swift
open func imageCropRect(forViewRect viewRect: CGRect) -> CGRect
Parameters
viewRect
The view rect to convert.
Return Value
The crop rect in image dimensions.
-
Returns whether the user has touched the content to initiate scrolling.
Note
The value of this property istrue
if the user has touched the image but might not have yet have started dragging it.Declaration
Swift
fileprivate(set) open var isTracking = false
-
Returns whether the content is moving in the view after the user lifted their finger.
Note
The returned value istrue
if user isn’t dragging the content but scrolling is still occurring.Declaration
Swift
open var isDecelerating: Bool
-
The frame of the crop canvas.
Declaration
Swift
open var canvasFrame: CGRect