I’m learning about basic manipulation of UIImages using Objective-C on iOS. Say I have a square 128×128 image. How can I crop the bottom half of the image and store just the top half in a 128×64 image?
I’m learning about basic manipulation of UIImage s using Objective-C on iOS. Say I
Share
What you do is get a smaller CGImageRef from the UIImage’s CGImage:
With that image you can then create a new image:
Oops almost forgot, after you do the above: