开发者

iPhone - How do I draw a CGImage on anouther CGImage

- (UIImage*) getImage {开发者_StackOverflow

    CGImage imgA = ....
    CGImage imgB = ....

    // ...

    //  I want to draw imgA onto imgB and return the result

Do I need a Graphics then use CGContextDrawImage(); or can I do it another way?


  1. Create a context. (e.g. a Bitmap context CGBitmapContextCreate)
  2. Draw image A with CGContextDrawImage
  3. Draw image B with CGContextDrawImage
  4. Obtain the composited image with CGBitmapContextCreateImage (if you are using a Bitmap context)

This blog post has a code sample:
http://www.realdevelopers.com/blog/code/compositing-two-uiimages-in-objective-c

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜