0
A
回答
1
一言以蔽之:
CGImageRef screen = UIGetScreenImage();
UIImage *screenImage = [UIImage imageWithCGImage:screen];
+1
除此之外,不在API文檔中。 Apple可能不允許在App Store中使用未公開API的應用程序。 – 2009-10-21 09:48:23
11
此代碼添加到您的UIViewController創建其的UIView的屏幕轉儲。
// create screen dump of the view of this view controller
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// save image to photos
UIImageWriteToSavedPhotosAlbum(screenShot, self, nil, nil);
相關問題
- 1. 創建一部分屏幕的圖像?
- 2. 如何創建一個像iPhone主屏幕的圖標網格?
- 3. iPhone全屏幕圖像
- 4. 從Webview創建帶有內容的屏幕的位圖Android
- 5. iPhone imageview打印屏幕 - 從imageview創建新圖像
- 6. iPhone SDK加載屏幕
- 7. 擬合內容到iPhone屏幕
- 8. 如何創建iPhone周圍金屬鉻的iPhone屏幕截圖
- 9. iPhone:屏幕截圖
- 10. iPhone屏幕截圖
- 11. UIInterfaceOrientation在iphone中的默認屏幕sdk
- 12. 如何爲所有屏幕尺寸創建圖像作爲背景圖像
- 13. 創建像iPhone主屏幕滾動型帶和按鈕
- 14. 將圖像對齊到每個屏幕的底部Corona SDK
- 15. iPad/iPhone屏幕鏡像
- 16. Android AlertDialog topPanel視圖將屏幕內容推出屏幕
- 17. iPhone上的屏幕截圖
- 18. 從Flash Player屏幕截圖內容
- 19. 內容在iPad的屏幕沒有安裝在變更在iPhone屏幕
- 20. 滾動android屏幕上的圖像屏幕上的圖像
- 21. iPhone SDK:初始屏幕拉伸
- 22. 創建許可屏幕像PlayStore
- 23. 創建屏幕外佈局的位圖
- 24. 在Android中從視圖/屏幕創建圖像
- 25. 爲iPhone創建SDK
- 26. iPhone - 用CGGradientCreateWithColorComponents幫助並根據屏幕截圖創建漸變
- 27. 如何從iPhone SDK中的視頻中提取屏幕截圖?
- 28. 內容比屏幕更寬
- 29. 打印管內容屏幕
- 30. Android:內容關閉屏幕
你應該接受最能幫助你解決問題的答案! – Saurabh 2011-06-01 06:00:07