views:

164

answers:

2
+1  Q: 

Combining images

I want to place the picked image ontop of another image, so that my picked image wil be placed in some sort of frame i made in photoshop. After combining the images i want to save it to the disk.

Does anyone knows how to do it, or mayby a link to examples?

+1  A: 

You can just layer the two images on top of each other, first add the frame image, then add the image with the photo...

Heres sample code

Assuming your 2 images are already sized correctly to fit one on top of t he other, this code would be in a view controller

UIImageView *frame=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Frame.png"]];
UIImageView *pic=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pic.png"]];
frame.center=[self.view center];
pic.center=[self.view center];
[self.view addSubview:frame];
[self.view addSubview:pic];

here it is, memory managment has not been written in..

Daniel
I understand, but i need to have some example code, or some link where its explained.
Ton
check out the edit
Daniel
Great, i am going to try that out!, i was allready trying things with Quartz and trying to mask the images ontop of each other, but i am going to give this a go. thanks.
Ton
I forget to mention that i wanted to save the two combined images to the disk, can i do that with your method?
Ton
No it does not, You want to create an image from the two images?
Daniel
Yes i want to create an image from two images, i am not so good in english so thats way i am so unclear, sorry.
Ton
thats going to be a little more complicated
Daniel
A: 

You can also add the picture UIImageView directly the the frame UIImageView: same as Daniel's suggestion above, but [frame.view addSubview: pic] instead.

Amagrammer