iPhone objective c 截屏代碼
來源:易賢網(wǎng) 閱讀:1601 次 日期:2014-11-04 08:59:20
溫馨提示:易賢網(wǎng)小編為您整理了“iPhone objective c 截屏代碼”,方便廣大網(wǎng)友查閱!

objective c 截屏代碼

-(void)save{

UIGraphicsBeginImageContext(mybackgroundview.bounds.size); //currentView 當(dāng)前的view

[mybackgroundview.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

}截取 您想要的一層

UIGraphicsBeginImageContext(CGSizeMake(320, 300)); //currentView 當(dāng)前的view

[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

截取自定義的大小

剛剛用到 不知道 是不是您想要的

更多信息請查看IT技術(shù)專欄

更多信息請查看技術(shù)文章
易賢網(wǎng)手機網(wǎng)站地址:iPhone objective c 截屏代碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權(quán)所有:易賢網(wǎng)