2012-05-21 226 views

回答

0

就像任何建議和源代碼所以:

- (UIImage *) captureScreen { 
    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow]; 
    CGRect rect = [keyWindow bounds]; 
    UIGraphicsBeginImageContext(rect.size); 
    CGContextRef context = UIGraphicsGetCurrentContext(); 
    [keyWindow.layer renderInContext:context]; 
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); 
    UIGraphicsEndImageContext(); 
    return img; 
} 

使用下面的教程然後保存圖像相機膠捲 http://mobiledevelopertips.com/camera/save-an-image-to-camera-roll.html