1

I want to place the picked image on top of another image, so that my picked image will 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 know how to do it, or maybe have a link to examples?

Bart
  • 19,692
  • 7
  • 68
  • 77
Ton
  • 365
  • 4
  • 19

2 Answers2

1

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
  • 22,363
  • 9
  • 64
  • 71
  • 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 Jul 31 '09 at 14:56
  • I forget to mention that i wanted to save the two combined images to the disk, can i do that with your method? – Ton Jul 31 '09 at 15:00
  • No it does not, You want to create an image from the two images? – Daniel Jul 31 '09 at 15:24
  • 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 Jul 31 '09 at 15:28
  • thats going to be a little more complicated – Daniel Jul 31 '09 at 15:32
0

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
  • 6,385
  • 3
  • 28
  • 30