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.68k stars 932 forks source link

[Question] How to change cropping square size #520

Closed sugitatestblue closed 3 months ago

sugitatestblue commented 2 years ago

What are you trying to achieve with this library exactly? Please describe.

I want to change cropping square size.

I want to set square.

I tried these options. but never work.

cropvc.customAspectRatio = CGSize(width: 300, height: 300)
//                cropvc.cropView.frame = CGRect(x: 0, y: 0, width: 300, height: 300)

//                cropvc.imageCropFrame = CGRect(x: 0, y: 0, width: 300, height: 300)
//                cropvc.accessibilityFrame = CGRect(x: 0, y: 0, width: 300, height: 300)

change

sugitatestblue commented 2 years ago

@TimOliver

I use cropvc.cropView.cropViewPadding. It make cropping square small, but ratio changes....

sugitatestblue commented 2 years ago

Dragging and change and change ratio.

TimOliver commented 2 years ago

Hi @sugitatestblue!

Hmm, what sort of feature are you building where you need the padding to be so big? If you set the aspect ratio to 1:1 and then update the padding values, maybe that will give you the effect you want here.

TimOliver commented 3 months ago

Closing this out now. I feel like the best thing that can be done here is to file a PR to make the insetting of the crop box controllable externally. Thanks!