UIGraphicsBeginImageContext(yourView.bounds.size);
[yourView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* image1 = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();当然, 你可以在UIGraphics.h中找到更多方法来生成PDF文档等. 记得包含 QuartzCore.framework.
阅读(883) | 评论(0) | 转发(0) |