Save a camera photo with an overlayed image - ipho

2019-05-30 11:36发布

问题:

I think this should be simple but I am having some difficulty implementing it.

I take a photo from the camera, the user can then move and scale it.

They then choose "use" and they get a preview of their image.

Now what I want to do is overlay an image on top of this preview image - which is also ok.

But the part I am having difficulty is then I want to save the photo taken WITH the image that is over it into the library. I just have a UIView with my overlay image about the UIView where my camera photo is previewed. I guess I just need to take a screen capture of these? I don't want to loose resolution OR end up with my UI buttons etc in the final image.

Any suggestions or links would be really useful. Thanks :-)

回答1:

try using

CGImageRef screen = UIGetScreenImage();
UIImage* screenImage = [UIImage imageWithCGImage:screen];
CGImageRelease(screen);