UIImage 的常用分类

作者: 家丁三锅 | 来源:发表于2016-11-13 16:46 被阅读53次

对一些常用UIImage 图片处理的功能做了简单的封装,不多,如果有什么需求的,可以留言在下面,我再加进去。


  • 图片裁剪,适用于圆形头像的裁剪,可以自己设置边框大小和颜色
+ (UIImage *)imageWithClipImage:(UIImage *)image borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)color;
  • 截屏功能
+ (UIImage *)imageWithCaptureView:(UIView *)captureView;
  • 根据颜色生成图片
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;
  • 根据文字生成水印图片 rect 是相对图片大小的位置
+ (UIImage *)imageWithWaterMarkImage:(NSString *)imageName text:(NSString *)str textRect:(CGRect)rect;
  • 改变图片大小缩放
+ (UIImage *)imageWithOriginImage:(UIImage *)image scaleToSize:(CGSize)size;

重点来了———> 代码下载地址

相关文章

网友评论

    本文标题:UIImage 的常用分类

    本文链接:https://www.haomeiwen.com/subject/enecpttx.html