jdl
jdl

Reputation: 6323

How to take graphics drawn in the UIView and save as a jpg or something else on the iPhone to pull up in the "Photos"?

How to take graphics drawn in the UIView and save as a jpg or something on the iPhone to pull up in the "Photos" and or attach to an email?

thanks

Upvotes: 1

Views: 552

Answers (1)

Daniel Eckhart
Daniel Eckhart

Reputation: 1099

It's fairly straightforward to get a UIImage:

UIImage* image = nil;

UIGraphicsBeginImageContext(_myView.frame.size);
{
    [_myView.layer renderInContext: UIGraphicsGetCurrentContext()];
    image = UIGraphicsGetImageFromCurrentImageContext();
}
UIGraphicsEndImageContext(); 

Then save to the photos library with this:

UIImageWriteToSavedPhotosAlbum(_myView, ,

Upvotes: 2

Related Questions