2012-09-22 79 views
1

有沒有將CGPath轉換爲UIImage的方法?將CGPath轉換爲UIImage

感謝

+0

你的意思是除了繪圖嗎? – user1118321

+0

可能是重複檢查此鏈接,可能會幫助你.. http://stackoverflow.com/questions/1836796/export-cgpath-as-jpg-or-png – vishy

回答

3
UIGraphicsBeginImageContext(size); 
// draw your path here 
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();  
UIGraphicsEndImageContext(); 
+0

問題是關於'CGPath'不是一個文件系統路徑。 – user1118321

0

如果你問你畫在上下文路徑,然後想,要轉換成圖像的裝置,然後UIGraphicsGetImageFromCurrentImageContext可能是你所需要的。