Merge two UIImages

后端 未结 2 2075
醉酒成梦
醉酒成梦 2021-02-08 05:48

I have imageA (taken from the users iPhone camera) and imageB, an image with a silly boarder (for eg) with plenty of transparent alpha space.

What I would like to to do

相关标签:
2条回答
  • 2021-02-08 05:52

    Note that for retina support you should use: UIGraphicsBeginImageContextWithOptions(size, YES, 0); // 0 means let iOS deal with scale for you

    0 讨论(0)
  • 2021-02-08 06:05

    That code looks correct (though I would recommend converting it to use a created CGBitmapContext for thread-safety), but is imageB supposed to be a JPEG? JPEGs don't support transparency, so, in order for the blending to work, it should really be a PNG.

    0 讨论(0)
提交回复
热议问题