//CGPath CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextSetAlpha(context, 0.9); CGContextBeginTransparencyLayer(context, NULL); UIBezierPath* circleOutlinePath = UIBezierPath.bezierPath; [circleOutlinePath moveToPoint: CGPointMake(165.83, 165.69)]; [circleOutlinePath addCurveToPoint: CGPointMake(165.83, 33.81) controlPoint1: CGPointMake(202.06, 129.27) controlPoint2: CGPointMake(202.06, 70.23)]; [circleOutlinePath addCurveToPoint: CGPointMake(34.67, 33.81) controlPoint1: CGPointMake(129.61, -2.6) controlPoint2: CGPointMake(70.89, -2.6)]; [circleOutlinePath addCurveToPoint: CGPointMake(34.67, 165.69) controlPoint1: CGPointMake(-1.56, 70.23) controlPoint2: CGPointMake(-1.56, 129.27)]; [circleOutlinePath addCurveToPoint: CGPointMake(165.83, 165.69) controlPoint1: CGPointMake(70.89, 202.1) controlPoint2: CGPointMake(129.61, 202.1)]; [circleOutlinePath closePath]; // [color4 setStroke]; circleOutlinePath.lineWidth = 5.5; [circleOutlinePath stroke]; UIBezierPath* trianglePath = UIBezierPath.bezierPath; [trianglePath moveToPoint: CGPointMake(64.5, 40.5)]; [trianglePath addLineToPoint: CGPointMake(164.5, 99.5)]; [trianglePath addLineToPoint: CGPointMake(64.5, 158.5)]; [trianglePath addLineToPoint: CGPointMake(64.5, 99.5)]; [trianglePath addLineToPoint: CGPointMake(64.5, 40.5)]; [trianglePath addLineToPoint: CGPointMake(64.5, 40.5)]; [trianglePath closePath]; trianglePath.lineCapStyle = kCGLineCapRound; CGContextEndTransparencyLayer(context); CGContextRestoreGState(context); // [color4 setFill]; [trianglePath fill]; // [color4 setStroke]; trianglePath.lineWidth = 1; [trianglePath stroke]; CAShapeLayer *maskLayer = [CAShapeLayer layer]; maskLayer.path = [circleOutlinePath CGPath]; CAShapeLayer *secondMaskLayer = [CAShapeLayer layer]; secondMaskLayer.path = [trianglePath CGPath]; [maskLayer addSublayer:secondMaskLayer];
Comments
0 B
|👍
/👎
0 B
|👍
/👎