Adding picture frame to a photo

亡梦爱人 提交于 2019-12-25 18:26:28

问题


I am making an app that adds a picture frame to a photo.I would like to know how to have my Save button save both Images (the photo, and the frame) as one Image.Right now it only saves one of the images.

In interface builder I have the save action saving the image that is loaded into an ImageView, with the frame ImageView overlaying that image.

I'd like to merge the two photos as one, so the save action can save the image with the frame.

Thanks!


回答1:


In this may need to use the masking in the iphone where the unnecessary thing of the image is automatically remove and attach with the frame.

I think this help to implement best for the your applications

So you can refer the following link for Download and tutorial and Source also.

Reference link




回答2:


You need to do some drawing using Core Graphics. This code should do what you want, possibly with some tweaks to the rectangles/sizes:

UIGraphicsBeginImageContext(image.size);
[image drawRect:CGRectMake(0, 0, image.size.width, image.size.height);
[frameImage drawRect:CGRectMake(0, 0, image.size.width, image.size.height);
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();


来源:https://stackoverflow.com/questions/8890781/adding-picture-frame-to-a-photo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!