可用以下代码:
UIGraphicsBeginImageContextWithOptions(size, opaque, scale); // code [view drawViewHierarchyInRect:rect afterScreenUpdates:YesOrNo]; UIImage *image=UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
时间: 2024-07-29 01:32:05