123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- //
- // Photo.h
- // Components
- // 照片处理对象
- // Created by Liu Yang on 10-9-15.
- // Copyright 2010 __MyCompanyName__. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- @interface NSData (MBBase64)
- + (id)dataWithBase64EncodedString:(NSString *)string; // Padding '=' characters are optional. Whitespace is ignored.
- - (NSString *)base64Encoding;
- @end
- @interface Photo : NSObject {
- }
- /*
- * 缩放图片
- * image 图片对象
- * toWidth 宽
- * toHeight 高
- * return 返回图片对象
- */
- +(UIImage *)scaleImage:(UIImage *)image toWidth:(int)toWidth toHeight:(int)toHeight;
- /*
- * 缩放图片数据
- * imageData 图片数据
- * toWidth 宽
- * toHeight 高
- * return 返回图片数据对象
- */
- +(NSData *)scaleData:(NSData *)imageData toWidth:(int)toWidth toHeight:(int)toHeight;
- /*
- * 圆角
- * image 图片对象
- * size 尺寸
- */
- +(id) createRoundedRectImage:(UIImage*)image size:(CGSize)size;
- /*
- * 图片转换为字符串
- */
- +(NSString *) image2String:(UIImage *)image;
- +(NSData *) image2Data:(UIImage *)image isOriginal:(BOOL)isOriginal; // isOriginal 是否原图
- /*
- * 字符串转换为图片
- */
- +(UIImage *) string2Image:(NSString *)string;
- @end
|