很早之前ios开发用到的图片处理的方法,美工只给了一张png图然后用来用来做一个蒙层的
+(UIImage*)imageToClear:(UIImage*) anImage
{
CGImageRef imageRef = anImage.CGImage;
size_t width = CGImageGetWidth(imageRef); //获取图片像素的宽
size_t height = CGImageGetHeight(imageRef); //获取图片像素的高
size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);
size_t bitsPerPixel = CGImageGetBitsPerPixel(imageRef);
size_t bytesPerRow = CGImageGetBytesPerRow(imageRef);
CGColorSpaceRef colorSpace = CGImageGetColorSpace(imageRef);
CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
bool shouldInterpolate = CGImageGetShouldInterpolate(imageRef);
CGColorRenderingIntent intent = CGImageGetRenderingIntent(imageRef);
CGDataProviderRef dataProvider = CGImageGetDataProvider(imageRef);