我有UIImageView图像和一些点(CGPOint值)。我可以像这样创建路径
var mutablePath = CGPathCreateMutable()
var point1 = patternImageView.someFeature.rightPoints.objectAtIndex(1).CGPointValue()
CGPathMoveToPoint(mutablePath, nil, point1.x, point1.y)
point1 = patternImageView.someFeature.rightPoints.objectAtIndex(2).CGPointValue()
CGPathAddLineToPoint(mutablePath, nil, point1.x, point1.y)
point1 = patternImageView.someFeature.rightPoints.objectAtIndex(3).CGPointValue()
CGPathAddLineToPoint(mutablePath, nil, point1.x, point1.y)
point1 = patternImageView.someFeature.rightPoints.objectAtIndex(4).CGPointValue()
CGPathAddLineToPoint(mutablePath, nil, point1.x, point1.y)
CGPathCloseSubpath(mutablePath)
var pathForRight:CGPathRef = mutablePath
我可以使用像这样的路径中的所有点创建矩形
var rectRight = CGPathGetBoundingBox(pathForRight)
或者我可以将数组添加为NSValue
var arrayRect = NSMutableArray()
arrayRect.addObject(NSValue(CGRect: CGPathGetBoundingBox(pathForRight)))
是否可以更改rect“rectRight”中所有像素的饱和度或更改某些矩形图像的饱和度?