TimOliver / TOCropViewController

A view controller for iOS that allows users to crop portions of UIImage objects
http://www.timoliver.com.au/2015/06/21/tocropviewcontroller-an-open-source-image-cropper-for-ios/
MIT License
4.71k stars 938 forks source link

How to fix the size of the clipping area #491

Closed Rookie131 closed 3 years ago

Rookie131 commented 3 years ago

I am using Brightroom and I find that the default crop area can be changed by the user. I want the cropping area to be fixed in size. How to achieve it?

image

Just like the make profile picture crop area of your example is fixed

image
cozzin commented 3 years ago

@Rookie131 Hi, I hope this code helps you.

cropController.customAspectRatio = CGSize(width: 300, height: 200)
cropController.cropView.cropBoxResizeEnabled = false
Rookie131 commented 3 years ago

Hi @cozzin Thank you for your answer