自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

iPhone開發(fā)應(yīng)用中抓圖程序案例實(shí)現(xiàn)

移動開發(fā) iOS
iPhone開發(fā)應(yīng)用中抓圖程序案例實(shí)現(xiàn)是本文要介紹的內(nèi)容,主要是通過代碼來實(shí)現(xiàn)抓圖程序,具體實(shí)現(xiàn)過程,一起來看詳細(xì)代碼。

iPhone開發(fā)應(yīng)用中抓圖程序案例實(shí)現(xiàn)是本文要介紹的內(nèi)容,主要是通過代碼來實(shí)現(xiàn)抓圖程序,具體實(shí)現(xiàn)過程,一起來看詳細(xì)代碼。

  1. //獲得屏幕圖像  
  2. - (UIImage *)imageFromView: (UIView *) theView    
  3. {  
  4.       
  5.     UIGraphicsBeginImageContext(theView.frame.size);  
  6.     CGContextRef context = UIGraphicsGetCurrentContext();  
  7.     [theView.layer renderInContext:context];  
  8.     UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();  
  9.     UIGraphicsEndImageContext();  
  10.       
  11.     return theImage;  
  12. }  
  13.  
  14. //獲得某個范圍內(nèi)的屏幕圖像  
  15. - (UIImage *)imageFromView: (UIView *) theView   atFrame:(CGRect)r  
  16. {  
  17.     UIGraphicsBeginImageContext(theView.frame.size);  
  18.     CGContextRef context = UIGraphicsGetCurrentContext();  
  19.     CGContextSaveGState(context);  
  20.     UIRectClip(r);  
  21.     [theView.layer renderInContext:context];  
  22.     UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();  
  23.     UIGraphicsEndImageContext();  
  24.       
  25.     return  theImage;//[self getImageAreaFromImage:theImage atFrame:r];  

小結(jié):iPhone開發(fā)應(yīng)用中抓圖程序案例實(shí)現(xiàn)的內(nèi)容介紹完了,希望通過本文的學(xué)習(xí)能對你有所幫助!

責(zé)任編輯:zhaolei 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-15 15:44:46

iPhone開發(fā)PDF

2011-08-18 16:24:44

iPhone開發(fā)圖片

2011-08-17 16:12:20

iPhone應(yīng)用程序

2011-08-19 11:10:31

iPhone應(yīng)用

2011-08-19 10:13:05

iPhone開發(fā)

2011-08-18 15:24:40

iPhone國際化

2011-08-05 13:49:53

iPhone 應(yīng)用 開發(fā)

2011-08-19 10:05:30

iPhone開發(fā)

2011-08-18 16:42:07

iPhone應(yīng)用APNS推送

2011-08-15 11:23:41

iPhone開發(fā)循環(huán)滾動UIScrollVie

2011-08-15 18:02:32

iPhone開發(fā)表視圖

2011-08-10 17:37:00

iPhoneASIHTTPRequ

2011-08-16 15:36:47

iPhone應(yīng)用測試

2011-08-17 16:23:31

iPhone開發(fā)UIViewContr

2011-07-26 09:41:23

iPhone xcode Mac OS X

2010-08-27 10:41:41

iPhone核心應(yīng)用程序

2011-08-12 14:54:45

iPhone委托

2011-07-26 11:13:15

iPhone PXL

2011-08-09 17:12:30

iPhoneCFRunLoop

2011-08-12 14:33:06

iPhone緩存文件
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號