2012-07-10 100 views
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(); 
+0

你是如何开始图像上下文的? – 2012-07-10 20:57:50

回答

1

看来,无论是界限0,0,0,0或有与highlightP问题ATH。这些价值从何而来?

相关问题