1
我目前正在繪製一個UIImage一個UIBezierPath內像這樣的外邊緣:製作UIBezierPath半透明
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
UIBezierPath *polygonPath = [UIBezierPath bezierPath];
CGPoint curPoint = [self originalPoint:[[drawArray objectAtIndex:0]CGPointValue]];
// set the starting point for the lines
[polygonPath moveToPoint:curPoint];
// go through each point in drawArray and add it to polygonPath
for(NSInteger i = 1; i < [drawArray count]; i++) {
curPoint = [self originalPoint:[[drawArray objectAtIndex:i]CGPointValue]];
// scale point
curPoint = CGPointMake(curPoint.x, curPoint.y);
[polygonPath addLineToPoint:curPoint];
}
[polygonPath closePath];
[polygonPath addClip];
[image drawAtPoint:CGPointZero];
它的偉大工程,但是我想有「邊緣平滑」,稍透明,對於圖像,因爲我在另一個圖像上繪製它...現在邊緣非常粗糙。
感謝您的幫助!