我的問題是這樣的 -iPhone屏幕截圖轉換UIImageView
我有一個用戶可以自由旋轉的UIImageView。
我現在想要捕捉這個新旋轉的圖像。
下面的代碼可以截取單個視圖,但不幸返回 視圖在其未旋轉狀態下的屏幕截圖。
-(IBAction)captureScreen:(id)sender
{
UIGraphicsBeginImageContext(imgView.frame.size);
[imgView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(screenshot, nil, nil, nil);
}
任何想法如何保留這裏的輪換?
你可以把旋轉要實現什麼樣的代碼? –