2010-09-23 13 views

Respuesta

12

gusta esta (a máquina de la memoria, por lo que podría no ser 100% correcto):

// Get a UIImage from the view's contents 
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, view.contentScaleFactor); 
CGContextRef context = UIGraphicsGetCurrentContext(); 
[view.layer renderInContext:context]; 
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 
UIGraphicsEndImageContext(); 

// Convert UIImage to CGImage 
CGImageRef cgImage = image.CGImage; 
1

También asegúrese de que agregue

#import <QuartzCore/QuartzCore.h>

a su código

+0

: P lol realmente? haa –

Cuestiones relacionadas