2010-07-29 54 views
2

左右的截圖,我知道如何採取截圖與UIKit中:以一個iPhone應用程序混合的UIKit和OpenGL

UIWindow *window = [[[UIApplication sharedApplication] delegate] window]; 
UIGraphicsBeginImageContext(window.bounds.size); 
[window.layer renderInContext:UIGraphicsGetCurrentContext()]; 
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 
UIGraphicsEndImageContext(); 
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil); 

而且我知道如何採取截圖與OpenGL的

// Some preparation to read pixels into a buffer 
glReadPixels(0,0,backingWidth, backingHeight, GL_RGBA, GL_UNSIGNED_BYTE, buffer); 
// Some code to massage the raw pixel data into an image 

我的應用混合了OpenGL和UIKit,因此只使用一種方法拍攝的任何截圖看起來都不對。

什麼是要麼 一)COMPOSIT兩個圖像融合在一起或 b)採取的截圖,可以捕捉OpenGL和UIKit中的最佳方式一起

回答

0

This是一個類似的帖子裏面有一些答案。顯然,您可以使用UIGetScreenImageglReadPixels來完成此任務。希望有所幫助!