//開(kāi)啟位圖上下文,將圖片渲染到位圖上下文
?? ? ? ? ? ? ? UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, 0.0);
?? ? ? ? ? ? ? CGContextRef ctx = UIGraphicsGetCurrentContext();
? ? ? ? ? ? ? ?[self.layer? renderInContext:ctx];
? ? ? ? ? ? ? ?UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();