Adding Aspect ratios #499
Replies: 4 comments
-
Beta Was this translation helpful? Give feedback.
-
Hi TimOliver,
Thank you for your reply I was able to add the custom aspect ratios.
…On Thu, 6 Jan 2022, 8:10 pm Javier Fransiscus, ***@***.***> wrote:
Hi, I think you can set the cropViewController.customAspectRatio for a
custom aspect ratio
[image: Screen Shot 2022-01-06 at 22 39 04]
<https://user-images.githubusercontent.com/53168317/148399685-f9381968-32c8-43fa-99d8-6a15058380c6.png>
However, I could not figure how to set it
This was in the documentation
/**
A CGSize value representing a custom aspect ratio, not listed in the
presets.
E.g. A ratio of 4:3 would be represented as (CGSize){4.0f, 3.0f}
*/
—
Reply to this email directly, view it on GitHub
<#499 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVQDJJRNZRPBW36V5FC5WJLUUWSU5ANCNFSM5GLHTBCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
<TimOliver/TOCropViewController/repo-discussions/499/comments/1918940@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Turns out the reason it wasn't working it was because the example he gave was an objective c syntax. Hey Javier! It's supposed to match the same pattern as normal aspect ratios. So to make a 16:9 ratio like a standard PC monitor, you would set it as: CGSize(width: 16.0, height: 9.0) Good luck! So the swift syntax equivalent would be this CGSize(width: 16.0, height: 9.0) |
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification.
…On Sat, 8 Jan 2022, 8:38 pm Javier Fransiscus, ***@***.***> wrote:
Turns out the reason it wasn't working it was because the example he gave
was an objective c syntax.
This is the answer I got when I asked him on twitter:
Hey Javier! It's supposed to match the same pattern as normal aspect
ratios.
So to make a 16:9 ratio like a standard PC monitor, you would set it as:
CGSize(width: 16.0, height: 9.0)
Good luck!
Also, the main reason why this isn't working here is that CGSize syntax is
Objective-C, but I can see you're working in Swift. I provided the
equivalent Swift syntax above!
So the swift syntax equivalent would be this CGSize(width: 16.0, height:
9.0)
—
Reply to this email directly, view it on GitHub
<#499 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVQDJJUSQYHPGRHNJK74RZDUVBHPJANCNFSM5GLHTBCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
<TimOliver/TOCropViewController/repo-discussions/499/comments/1931995@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Could you please add a few more aspect ratios in the image cropper?
Beta Was this translation helpful? Give feedback.
All reactions