Reputation: 5417
I have several rectangular images (in landscape and portrait mode) and want to draw them onto a transparent square image, so that all images became the same size without cropping them. How would I create a transparent UIImage and draw another on top?
Thanks for any hints.
Upvotes: 5
Views: 3137
Reputation: 15136
CGBitmapContextCreate
. You'll need to determine what the size of the resulting composite image here. You can think of this as a sort of canvas.CGContextDrawImage
. This will draw images onto the same context.CGBitmapContextCreateImage
.[UIImage imageWithCGIImage:]
.Code examples can be found here.
Upvotes: 6