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 o开发者_开发技巧n the iPhone to pull up in the "Photos" and or attach to an email?
thanks
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, ,
精彩评论