开发者

How do I concatenate two images in objective c?

I have two UIImageView's, and 开发者_JAVA技巧I want to concatenate them both to be one UIImageView. To let you know, the images have some transparency to them so you will see both of them. Als they are the same size.


If you want to overlay one imageView over another, just set its backgroundColor to clear and move it over, either using IB or directly setting its frame via code.


hey if you are using two static image-views then you can do the this by taking the screen-shot with this code

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 UIGraphicsBeginImageContext(self.view.bounds.size);
 [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; 
 UIImage *savedImg = UIGraphicsGetImageFromCurrentImageContext();//here is the final image
 UIGraphicsEndImageContext();
 [pool release];

Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜