UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(50, 50)]; [path addLineToPoint:CGPointMake(100, 50)]; path.lineWidth = 5.0f; path.lineJoinStyle = kCGLineJoinRound; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(50, 50)]; [path addLineToPoint:CGPointMake(300, 50)]; [path addLineToPoint:CGPointMake(200, 150)]; // 最后的闭合线是可以通过调用closePath方法来自动生成的,也可以调用-addLineToPoint:方法来添加 // [path addLineToPoint:CGPointMake(50, 50)]; [path closePath]; path.lineWidth = 5.0f; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithRect:CGRectMake(50, 100, 50, 50)]; path.lineWidth = 5.0f; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 200, 50, 50)]; path.lineWidth = 5.0f; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 200, 50, 100)]; path.lineWidth = 5.0f; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(50, 300, 50, 50) cornerRadius:15.0f]; path.lineWidth = 5.0f; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(50, 400, 50, 50) byRoundingCorners:UIRectCornerBottomLeft cornerRadii:CGSizeMake(5,5)]; path.lineWidth = 5.0f; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(100, 550) radius:25 startAngle:0 endAngle:1.5*M_PI clockwise:YES]; path.lineWidth = 5.0f; [path stroke];
UIBezierPath *path_A = [UIBezierPath bezierPath]; [path_A moveToPoint:CGPointMake(200, 50)]; [path_A addLineToPoint:CGPointMake(250, 100)]; path_A.lineWidth = 5.0f; UIBezierPath *path_B = [UIBezierPath bezierPathWithCGPath:path_A.CGPath]; [path_B stroke];
UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(100, 200)]; [path addCurveToPoint:CGPointMake(300, 200) controlPoint1:CGPointMake(150, 150) controlPoint2:CGPointMake(250, 250)]; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(100, 200)]; [path addQuadCurveToPoint:CGPointMake(300, 200) controlPoint:CGPointMake(150, 150)]; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(200, 400)]; [path addLineToPoint:CGPointMake(225, 410)]; [path addArcWithCenter:CGPointMake(200, 400) radius:25 startAngle:0 endAngle:1.5*M_PI clockwise:YES]; // [path closePath]; // [path removeAllPoints]; [path stroke];
UIBezierPath *path_A = [UIBezierPath bezierPath]; [path_A moveToPoint:CGPointMake(200, 500)]; [path_A addLineToPoint:CGPointMake(225, 410)]; UIBezierPath *path_B = [UIBezierPath bezierPath]; [path_B moveToPoint:CGPointMake(200, 600)]; [path_B addLineToPoint:CGPointMake(225, 500)]; [path_A appendPath:path_B]; [path_A stroke];
UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(50, 50)]; [path addLineToPoint:CGPointMake(100, 50)]; path.lineWidth = 5.0f; NSLog(@"%@",NSStringFromCGPoint(path.currentPoint)); UIBezierPath *path_b = [path bezierPathByReversingPath]; CGAffineTransform transform = CGAffineTransformMakeTranslation(200, 0); [path_b applyTransform: transform]; // 两条路径分别添加一条直接到 self.center [path addLineToPoint: CGPointMake(self.frame.size.width*0.5, self.frame.size.height*0.5)]; [path_b addLineToPoint: CGPointMake(self.frame.size.width*0.5, self.frame.size.height*0.5)]; NSLog(@"%@",NSStringFromCGPoint(path_b.currentPoint)); [[UIColor redColor] set]; [path stroke]; [[UIColor blueColor] set]; [path_b stroke];
UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(100, 50)]; [path addLineToPoint:CGPointMake(200, 50)]; CGAffineTransform transform = CGAffineTransformRotate(self.transform, M_PI_4); [path applyTransform:transform]; path.lineWidth = 5.0f; [path stroke];
CGFloat dashStyle[] = {1.0f, 2.0f};
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(50, 50)];
[path addLineToPoint:CGPointMake(100, 50)];
[path setLineDash:dashStyle count:2 phase:0.0];
[path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(100, 100, 100, 100)]; [[UIColor greenColor] setStroke]; [[UIColor redColor] setFill]; [path stroke]; [path fill];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(100, 100, 100, 100)]; [[UIColor greenColor] setStroke]; path.lineWidth = 10.0f; [path strokeWithBlendMode:kCGBlendModeSaturation alpha:1.0]; [path stroke];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(100, 100, 100, 100)]; [[UIColor redColor] setFill]; [path fillWithBlendMode:kCGBlendModeSaturation alpha:0.6]; [path fill];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(100, 100, 100, 100)]; [[UIColor greenColor] setStroke]; [path addClip]; [path stroke];
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有