ZBCornerRadiusTool.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // ZBCornerRadiusTool.h
  3. // ZBCornerDemo
  4. //
  5. // Created by Zuobian on 2019/12/24.
  6. // Copyright © 2019 admin. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface ZBCornerRadiusTool : NSObject
  12. /// 绘制裁剪圆角后图片
  13. /// @param radius 圆角
  14. /// @param rectSize 视图尺寸
  15. /// @param fillColor 填充色
  16. /// @param cornerStyle 圆角位置
  17. + (UIImage *)drawAntiRoundedCornerImageWithRadius:(float)radius rectSize:(CGSize)rectSize fillColor:(UIColor *)fillColor cornerStyle:(UIRectCorner)cornerStyle;
  18. /// 绘制裁剪圆角后图片
  19. /// @param radius_TL 左上角半径
  20. /// @param radius_TR 右上角半径
  21. /// @param radius_BL 左下角半径
  22. /// @param radius_BR 右下角半径
  23. /// @param rectSize 视图尺寸
  24. /// @param fillColor 填充色
  25. + (UIImage *)drawAntiRoundedCornerWithRadius_TL:(float)radius_TL
  26. radius_TR:(float)radius_TR
  27. radius_BL:(float)radius_BL
  28. radius_BR:(float)radius_BR
  29. rectSize:(CGSize)rectSize
  30. fillColor:(UIColor *)fillColor;
  31. // 对任意一个或多个角设置圆角
  32. + (UIBezierPath *)configPathWithRadius:(float)radius rectSize:(CGSize)rectSize cornerStyle:(UIRectCorner)cornerStyle fillColor:(UIColor *)fillColor;
  33. @end
  34. NS_ASSUME_NONNULL_END