You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
2.2 KiB

//
// MOBFImageUtils.h
// MOBFoundation
//
// Created by vimfung on 15-1-19.
// Copyright (c) 2015年 MOB. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/**
*
*/
typedef NS_ENUM(NSUInteger, MOBFOvalType)
{
/**
*
*/
MOBFOvalTypeNone = 0x00,
/**
*
*/
MOBFOvalTypeLeftTop = 0x01,
/**
*
*/
MOBFOvalTypeLeftBottom = 0x02,
/**
*
*/
MOBFOvalTypeRightTop = 0x04,
/**
*
*/
MOBFOvalTypeRightBottom = 0x08,
/**
*
*/
MOBFOvalTypeAll = MOBFOvalTypeLeftTop | MOBFOvalTypeLeftBottom | MOBFOvalTypeRightTop | MOBFOvalTypeRightBottom
};
/**
*
*/
@interface MOBFImage : NSObject
/**
*
*
* @param image
* @param rect
*
* @return
*/
+ (UIImage *)clipImage:(UIImage *)image withRect:(CGRect)rect;
/**
*
*
* @param image
* @param size
* @param ovalWidth
* @param ovalHeight
* @param ovalType
*
* @return
*/
+ (UIImage *)roundRectImage:(UIImage *)image
withSize:(CGSize)size
ovalWidth:(CGFloat)ovalWidth
ovalHeight:(CGFloat)ovalHeight
ovalType:(MOBFOvalType)ovalType;
/**
*
*
* @param image
* @param size
*
* @return
*/
+ (UIImage *)scaleImage:(UIImage *)image withSize:(CGSize)size;
/**
*
*
* @param name
* @param bundle
*
* @return
*/
+ (UIImage *)imageName:(NSString *)name bundle:(NSBundle *)bundle;
/**
*
*
* @param view
*
* @return
*/
+ (UIImage *)imageByView:(UIView *)view;
/**
*
*
* @param view
* @param opaque YESNO
*
* @return
*/
+ (UIImage *)imageByView:(UIView *)view opaque:(BOOL)opaque;
@end