(IOS)判断该图片是否有透明度通道

- (BOOL)hasAlphaChannel

{

    CGImageAlphaInfoalpha = CGImageGetAlphaInfo(self.CGImage);

    return (alpha == kCGImageAlphaFirst ||

            alpha ==kCGImageAlphaLast||

            alpha ==kCGImageAlphaPremultipliedFirst ||

            alpha ==kCGImageAlphaPremultipliedLast);

}

你可能感兴趣的:((IOS)判断该图片是否有透明度通道)