views:

103

answers:

1

I'd like to be able to take a picture (camera or library) and overlay something like a picture frame on it, then save it back to the camera roll. Should I be looking into OpenGL?or, what?

Thanks for the pointers.

+4  A: 

You don't need anything except Quartz for that. Look into CGBitmapContext, CGContext, CGImage, UIImage. There's also a function to store images in the album: UIImageWriteToSavedPhotosAlbum

The way to go is:

  1. Get a UIImage from UIImagePickerController.
  2. Build a context using CGBitmapContextCreate
  3. Draw the image in this context: CGContextDrawImage
  4. Draw whatever you want on top of that
  5. Use CGBitmapContextCreateImage to create a CGImage from the context
  6. Use [UIImage imageWithCGImage:] to get a UIImage from the CGImage
  7. Use UIImageWriteToSavedPhotosAlbum to save the augmented image.
Nikolai Ruhe
Many thanks, I'll read up on these.
nullArray