#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKitDefines.h> NS_ASSUME_NONNULL_BEGIN typedef NS_OPTIONS(NSUInteger, UIRectCorner) {
UIRectCornerTopLeft = << ,
UIRectCornerTopRight = << ,
UIRectCornerBottomLeft = << ,
UIRectCornerBottomRight = << ,
UIRectCornerAllCorners = ~0UL
}; NS_CLASS_AVAILABLE_IOS(3_2) @interface UIBezierPath : NSObject<NSCopying, NSSecureCoding> //初始化
+ (instancetype)bezierPath; //初始化一个矩形路径
+ (instancetype)bezierPathWithRect:(CGRect)rect; //初始化一个椭圆路径,相切矩形的四条边。
+ (instancetype)bezierPathWithOvalInRect:(CGRect)rect; //初始化一个圆角矩形,矩形区域 边角半径
+ (instancetype)bezierPathWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius; /**
初始化圆角矩形 @param rect 矩形区域
@param corners 枚举:哪个角是圆角(多个时用 ‘|’分开)
@param cornerRadii 圆角半径
*/
+ (instancetype)bezierPathWithRoundedRect:(CGRect)rect byRoundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii; /**
初始化一个开放圆弧路径 @param center 圆心
@param radius 半径
@param startAngle 开始角度(0-M_PI)
@param endAngle 结束角度
@param clockwise 是否顺时针
*/
+ (instancetype)bezierPathWithArcCenter:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise; //根据CGPath初始化对象
+ (instancetype)bezierPathWithCGPath:(CGPathRef)CGPath; - (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; //设置路径,也可以获取一个不可变的路径!
@property(nonatomic) CGPathRef CGPath;
- (CGPathRef)CGPath NS_RETURNS_INNER_POINTER CF_RETURNS_NOT_RETAINED; //移动到当前点
- (void)moveToPoint:(CGPoint)point; //到当前点画一条直线
- (void)addLineToPoint:(CGPoint)point; /**
追加画一条三次贝塞尔曲线 @param endPoint 结束点
@param controlPoint1 控制点1
@param controlPoint2 控制点2
*/
- (void)addCurveToPoint:(CGPoint)endPoint controlPoint1:(CGPoint)controlPoint1 controlPoint2:(CGPoint)controlPoint2; /**
追加画一条二次贝塞尔曲线 @param endPoint 结束点
@param controlPoint 控制点
*/
- (void)addQuadCurveToPoint:(CGPoint)endPoint controlPoint:(CGPoint)controlPoint; /**
追加一条圆弧 @param center 中心点
@param radius 半径
@param startAngle 开始角度
@param endAngle 结束角度
@param clockwise 是否顺时针
*/
- (void)addArcWithCenter:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise NS_AVAILABLE_IOS(4_0); //闭合路径
- (void)closePath; //去除所有路径
- (void)removeAllPoints; //追加bezierPath
- (void)appendPath:(UIBezierPath *)bezierPath; // 将原来的UIBezierPath反方向绘制(两个路径一样,方向不一样)
- (UIBezierPath *)bezierPathByReversingPath NS_AVAILABLE_IOS(6_0); // 进行放射,2D变换
- (void)applyTransform:(CGAffineTransform)transform; // Path info
@property(readonly,getter=isEmpty) BOOL empty; //路径是否为空
@property(nonatomic,readonly) CGRect bounds; //路径区域
@property(nonatomic,readonly) CGPoint currentPoint; //当前点
- (BOOL)containsPoint:(CGPoint)point; //是否包含某个点 // Drawing properties
@property(nonatomic) CGFloat lineWidth; //线宽
@property(nonatomic) CGLineCap lineCapStyle; //曲线终点样式 枚举
@property(nonatomic) CGLineJoin lineJoinStyle; //曲线连接处样式 枚举
@property(nonatomic) CGFloat miterLimit; // 连接处lineJoinStyle值是kCGLineJoinMiter,内角与外角距离,最大限制10
@property(nonatomic) CGFloat flatness; //渲染精度(默认0.6),数值越小,精度越高也越耗时!
@property(nonatomic) BOOL usesEvenOddFillRule; // 是否使用基偶填充规则,(默认是NO 非零规则) /**
绘制虚线路径 @param pattern C语言数组 CGFloat xx[] = {线段长度,间隙长度}; 轮流
@param count 数组个数
@param phase 从第几个数开始绘制
*/
- (void)setLineDash:(nullable const CGFloat *)pattern count:(NSInteger)count phase:(CGFloat)phase; /**
获取虚线样式 @param pattern 数组(空间必须大于路径空间)
@param count 数组个数
@param phase 开始位数
*/
- (void)getLineDash:(nullable CGFloat *)pattern count:(nullable NSInteger *)count phase:(nullable CGFloat *)phase; - (void)fill; //填充
- (void)stroke; //画线 /**
混合填充 @param blendMode 填充模式 枚举
@param alpha 透明度
*/
- (void)fillWithBlendMode:(CGBlendMode)blendMode alpha:(CGFloat)alpha; /**
混合画线 @param blendMode 模式 枚举
@param alpha 透明度
*/
- (void)strokeWithBlendMode:(CGBlendMode)blendMode alpha:(CGFloat)alpha; //剪切路径 之后路径只能在区域里画线
- (void)addClip; @end NS_ASSUME_NONNULL_END

最新文章

  1. BPTT算法推导
  2. VMware安装增强工具
  3. Computer Graphics Research Software
  4. 比较body.onload(function())、$(document).ready(function())与$(windows).load(function)
  5. 外中断之swi软件中断:
  6. chrome 31删除输入框的历史记录
  7. Android消息机制(1)
  8. ios字符串截取
  9. docker学习笔记13:Dockerfile 指令 WORKDIR介绍
  10. OC版贪吃蛇
  11. App Doc View Frame中指针的获取
  12. Batch入门教程丨第一章:部署与Hello World!(上)
  13. 放弃antd table,基于React手写一个虚拟滚动的表格
  14. centos设置网卡开机自启动
  15. ANSI码和UNICODE码
  16. python安装pandas和lxml
  17. Microsoft&#174; SQL Server&#174; 2012 功能包
  18. 【android开发】如何在Linux平台下安装JDK环境
  19. python中@property和property函数使用
  20. mongoose中的流查询stream query

热门文章

  1. spring boot 结合jsp简单示例
  2. 天道神诀---防火墙以及selinux(上篇)
  3. WPF datagrid AutoGenerateColumns隐藏部分列
  4. c# 编写windows 服务,并制作安装包
  5. vagrant centos lamp小记
  6. CSIC_716_20191101【编程语言、变量、垃圾回收机制】
  7. K-Anonymous Sequence
  8. Python自学:第四章 在for循环中执行更多操作(2)
  9. 如何检测 Web 服务请求丢失问题
  10. 混合云存储组合拳:基于云存储网关与混合云备份的OSS数据备份方案