I’m facing the following problem : I have to merge two images A and B to create a new image C as a result of the merging.
I already know how to merge two images but in this case my goal is a little bit different.
I would like that image A will be the background for Image B.
For instance if image A size is 500×500 and image B size is 460×460 I would like that image C (the image result of the merging) will be 500×500, with image B (460×460) centered in it.
Thanks in advance for any help or suggestion
This is what I’ve done in my app, but without using
UIImageView:If the image already has opacity, you do not need to set it (as in bottomImage) otherwise you can set it (as with image).
After this
UIImageis created then you can embed it in yourUIImageViewUPDATE: Thanks to Ahmet AkkoK – for Swift (2.2) users blend mode macro has changed.
CGBlendMode .kCGBlendModeNormalis replaced withCGBlendMode.Normal