123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- //
- // UIImage+Extension.h
- // SmartLightForBigFish
- //
- // Created by coderYK on 2017/8/7.
- // Copyright © 2017年 RD-iOS. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- @class RDSRgbColor;
- @interface UIImage (Extension)
- /// 颜色生成图片
- + (UIImage *)rds_imageWithColor:(UIColor *)color;
- /// 生成渐变色图片
- + (UIImage *)rds_imageWithColor:(UIColor *)startColor toColor:(UIColor *)toColor imgSize:(CGSize)imgSize;
- /**
- 用于合成用户占位头像
- @param imageName 展位头像原图
- @param backgroundColor 占位图背景色
- @return 合成头像(圆形)
- */
- + (UIImage *)rds_imageWithName:(NSString *)imageName andBackgroundColor:(UIColor *)backgroundColor;
- /**
- * 根据传入的字符串以及指定的大小生成一张二维码图片
- *
- * @param string 传入的字符串
- * @param size 指定的尺寸大小
- *
- * @return 二维码图片
- */
- + (UIImage *)rds_creatQRCodeWithString:(NSString *)string withSize:(CGFloat)size;
- /**
- * 根据传入的数据以及指定的大小生成一张二维码图片
- *
- * @param data 传入的数据
- * @param size 指定的尺寸大小
- *
- * @return 二维码图片
- */
- + (UIImage *)rds_creatQRCodeWithData:(NSData *)data withSize:(CGFloat)size;
- /**
- 返回一张不被渲染的原始图片
- */
- + (UIImage *)rds_renderingOriginalimageWithName:(NSString *)imageName;
- - (RDSRgbColor *)rds_colorAtPixel:(CGPoint)point;
- /// 修改图片大小
- /// @param size CGRectMake
- - (UIImage *)rds_imageScaleToSize:(CGSize)size;
- /// 修改图片颜色
- - (UIImage *)rds_changeColorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue;
- @end
|