Search

Saving in photos using QuartzCore framework

Posted in Iphone, Ipad, Ipod by jdam on Apr 24th, 2010

A logic that lets you save your view as image to your saved photos. Here are the steps to follow:

1. Add QuartzCore framework.

2. Add IBAction in your header.
- (IBAction)fooView;

3. In your implementation add your IBAction similar to your header file.

- (IBAction)fooView {
UIGraphicsBeginImageContext(self.view.bounds.size) ;
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);

4. Lastly make sure to call #import to your implementation. Then set your button to your method.

Share

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.