TZImageCropManager.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // TZImageCropManager.h
  3. // TZImagePickerController
  4. //
  5. // Created by 谭真 on 2016/12/5.
  6. // Copyright © 2016年 谭真. All rights reserved.
  7. // 图片裁剪管理类
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. @interface TZImageCropManager : NSObject
  11. /// 裁剪框背景的处理
  12. + (void)overlayClippingWithView:(UIView *)view cropRect:(CGRect)cropRect containerView:(UIView *)containerView needCircleCrop:(BOOL)needCircleCrop;
  13. /*
  14. 1.7.2 为了解决多位同学对于图片裁剪的需求,我这两天有空便在研究图片裁剪
  15. 幸好有tuyou的PhotoTweaks库做参考,裁剪的功能实现起来简单许多
  16. 该方法和其内部引用的方法基本来自于tuyou的PhotoTweaks库,我做了稍许删减和修改
  17. 感谢tuyou同学在github开源了优秀的裁剪库PhotoTweaks,表示感谢
  18. PhotoTweaks库的github链接:https://github.com/itouch2/PhotoTweaks
  19. */
  20. /// 获得裁剪后的图片
  21. + (UIImage *)cropImageView:(UIImageView *)imageView toRect:(CGRect)rect zoomScale:(double)zoomScale containerView:(UIView *)containerView;
  22. /// 获取圆形图片
  23. + (UIImage *)circularClipImage:(UIImage *)image;
  24. @end
  25. /// 该分类的代码来自SDWebImage:https://github.com/rs/SDWebImage
  26. /// 为了防止冲突,我将分类名字和方法名字做了修改
  27. @interface UIImage (TZGif)
  28. + (UIImage *)sd_tz_animatedGIFWithData:(NSData *)data;
  29. @end