1
我沒有太多的代碼,迄今爲止,僅此展開:獲得無效的情況下錯誤
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGMutablePathRef outerPath;
CGMutablePathRef highlightPath;
CGRect outerRect = rectForRectWithInset(bounds, 1);
CGRect highlightRect = CGRectMake(outerRect.origin.x,
outerRect.origin.y + 1,
outerRect.size.width,
outerRect.size.height);
然後有問題的位,當其註釋掉,錯誤消失:
CGContextSaveGState(context);
CGContextAddPath(context, highlightPath);
CGContextSetFillColorWithColor(context, [[UIColor colorWithWhite:1.0 alpha:0.05]CGColor]);
CGContextFillPath(context);
CGContextRestoreGState(context);
下面是簡單的:
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
你是如何開始圖像上下文的? – 2012-07-10 20:57:50