How can i add two uiimageview and save it to iphone photo gallery in iphone application development?(如何在 iphone 应用程序开发中添加两个 uiimageview 并将其保存到 iphone 照片库?)
问题描述
我直奔主题,我的问题是,我有一个带有 3 个按钮和一个 uiimage 视图的 uiview 控制器.现在,
I am going straight to the point,my problem is, I have a uiview controller which is taking 3 buttons and a uiimage view.Now,
当我按下第一个按钮时,我正在从 iphone 默认照片库中获取图像并放置在 uiimageview 上.
When i am pressing first button i am taking image from iphone default photo gallery and placing on uiimageview.
当我按下第二个按钮时,它将从照片库中获取另一张图片并放置在上一张图片上.
When i am pressing second button it will take another image from photo gallery and placing on previous image.
现在当我按下第三个按钮时,这两个图像将添加并使其成为一张图像并保存在相册中.
Now when i will press third button those two image will add and make it one image and save in the photo album.
我已经完成了第 1 步和第 2 步,但我该怎么做第 3 步??
i have done step 1 and step 2 but how can i do step 3??
编辑
假设图片中有一个没有胡须的人 (image1),但我要添加另一个胡须图片 (image2) 来制作一个看起来像胡须男人的图片 (image3).我想将图片 3 保存在相册中.
suppose a man without beard in a picture(image1) but i am adding another beard image(image2) to make an image where he will look like beard man(image3). i want to save image 3 in photo album.
提前感谢您的帮助..
推荐答案
我自己也有同样的问题,以前我是这样解决的
myself also having same issue previously i solved this way
试试这个类别代码....
try this category code....
.h 文件:
.m 文件:
我的设计将是包含两个图像视图的视图(命名为组合视图),其中一个只是源图像[即没有胡须的人]在该图像顶部我有胡须图像...
my design will be view(named as combinedView) that contains two image view one is just the source image[i.e man without beard] on the top of that image i am having beard image...
然后我用这种方式制作图像......
then i make the image by this way....
要保存到相册使用这个...
for saving this to album use this...
试试这个想法....
新更新:这个结构你需要维护,并且 theView
的背景颜色也是清晰的颜色
New Update:
this structure you need to maintain and also theView
's background color as clear color
这篇关于如何在 iphone 应用程序开发中添加两个 uiimageview 并将其保存到 iphone 照片库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!