// UIImage+Alpha.h // Created by Trevor Harmon on 9/20/09. // Free for personal or commercial use, with or without modification. // No warranty is expressed or implied. // Helper methods for adding an alpha layer to an image #import @interface UIImage (Alpha) /** * @brief 是否有alpha通道 * * @return 是否有alpha通道 */ - (BOOL)hasAlpha; /** * @brief 如果没有alpha通道 增加alpha通道 * * @return 如果没有alpha通道 增加alpha通道 */ - (UIImage *)imageWithAlpha; /** * @brief 增加透明边框 * * @param borderSize 边框尺寸 * * @return 增加透明边框后的图片 */ - (UIImage *)transparentBorderImage:(NSUInteger)borderSize; //http://stackoverflow.com/questions/6521987/crop-uiimage-to-alpha?answertab=oldest#tab-top /** * @brief 裁切含透明图片为最小大小 * * @return 裁切后的图片 */ - (UIImage *)trimmedBetterSize; @end