-1

I am newer in iphone application development field so anybody help me any how. Now my problem is when i will click on a button then camera will open but additional problem is when camera frame will come then a image will on the photo frame and when i will click the capture button then background of the photo frame and the image will capture together. If any further question of anyone please do not hesitate to ask...

I hope i have explained in clearly if not please ask me.Its very urgent for me.

Thanks In Advance.

EXAMPLE: Suppose someone has seen a ring in an application. Now she wants to see how it looks like when she will wear it. so when she tap the ring then camera screen will open and this ring will be in the middle of the camera screen. Now she will take her hand under the camera then it will look like ring is in her hand. I think now i have explained it clearly.

Emon
  • 452
  • 3
  • 11
  • 21
  • It is very hard to understand what you want to do, and what your problem is. Are you failing to capture an image with the camera using an UIImagePickerController? – Krumelur Apr 09 '12 at 14:27
  • no...problem is when i will click camera button then an image will already on the camera frame. now when i will click capture button then this image and background of the frame will be captured together. i have edited my question. – Emon Apr 09 '12 at 14:38

1 Answers1

1

Try this (inspired from this question):

 - (UIImage*)addRing:(UIImage*)ringImage toPhoto:(UIImage*)photo;
{
  CGSize size = [photo size];
  UIGraphicsBeginImageContext(size);
  CGRect rect = CGRectMake(0, 0, size.width, size.height);
  [photo drawInRect:rect blendMode:kCGBlendModeNormal alpha:1.0];
  CGRect ringRect = <<< find suitable bounds for ring image here >>>
  [ringImage drawInRect:ringRect blendMode:kCGBlendModeNormal alpha:1.0];

  UIImage *resultingImage =  UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  return resultingImage;
}
Community
  • 1
  • 1
Krumelur
  • 31,081
  • 7
  • 77
  • 119