2010-09-23 11 views

risposta

12

Ti piace questa (digitato dalla memoria, quindi potrebbe non essere corretta al 100%):

// 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

Assicurarsi inoltre di aggiungere

#import <QuartzCore/QuartzCore.h>

al codice

+0

: P lol davvero? haa –

Problemi correlati