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.73k stars 951 forks source link

image position #221

Closed rakeshkathoju closed 6 years ago

rakeshkathoju commented 6 years ago

how can i use cropview from storyboard. and set image position to center

Thanks for considering filing an issue! Before proceeding, please consider the type of issue you're filing and make sure to supply the proper details needed for it! :)

Please note that your issue may be closed without review if you do not supply the information that is requested here. Since this library is done as a side-project outside of work hours, please understand that a timely response cannot be guaranteed. ;)

For CocoaPods Users

Before filing a bug report, please make sure you are using the latest version of CocoaPods (gem install cocoapods), and the latest version of this library (pod repo update).

Support for CocoaPods-related issues is not provided unless you confirm both of these points in your submission.

Issue Types

Questions: Please check the closed issues to see if it's already been asked before.

Feature Request: Please fill in just the first two sections. Please be as thorough as possible and explain how you would expect this feature to work both visually, and from an API perspective.

Bugs: Please be as thorough as possible when describe the bug you've discovered. If it's a visual bug, please add a screenshot. If it's an animation bug, please provide a recording of the bug in action.


Hardware / Software

Which version of the library were you using? Which version of iOS are you running? What model of iOS device were you testing on? If using CocoaPods, which version of CocoaPods are you on?

Goals

What is the outcome result you want to achieve with this library?

Expected Results

What did you expect to happen?

Actual Results

What happened instead? (Please attach a screenshot/screen recording if possible)

Steps to Reproduce

What are the steps needed to reproduce this issue? If this bug was caused by a specific image, please post it here.

TimOliver commented 6 years ago

Uhh, thanks for submitting a new issue, @rakeshkathoju. But you're supposed to fill out those questions at the bottom! 😅

Anyway, to answer your question as best as I can: TOCropViewController doesn't implement IBInspectable, so it can't really be configured in Interface Builder.

You should be able to use the 'User Defined Runtime Attributes' window in IB to set any initial parameters you'd like the crop view controller to have.

screen shot 2017-11-27 at 5 37 35 pm

I'm not sure what you mean by 'set image position to center'. The image is automatically centered by default. If you want to zoom in, you'll need to manually calculate the crop frame of the region you want to focus on, which might need to be done in code over IB.

Good luck!

rakeshkathoju commented 6 years ago

this is what i am getting simulator screen shot - iphone 8 plus - 2017-11-27 at 17 06 58

by my expected is simulator screen shot - iphone 8 plus - 2017-11-27 at 17 07 02