开发者

Combine 2 UIImages as one, one of them is rotated

开发者 https://www.devze.com 2023-03-30 23:26 出处:网络
I\'m getting at one point with iOS. I have 2 UIImage which are bgImg & img. BgImg is actually the background image, img is a smaller one which places in the bgImg\' bounds.

I'm getting at one point with iOS. I have 2 UIImage which are bgImg & img. BgImg is actually the background image, img is a smaller one which places in the bgImg' bounds.

I need to combine 2 of these images as one, called finalImg. The problem is img should be rotated in a select angle. I have done so many tests with no result. If you have any ideas, please help me. What I need is just to return the combined imag开发者_开发问答e.

Thanks so much, my fellow iOS developers. Thang


You need to create a graphics context, draw your two images to it, and then capture a new image from the context, as described in this post: Saving 2 UIImages to one while saving rotation, resize info and its quality

If you don't already have the rotation of your foreground image worked out, then the first answer to that post should help you as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消