首页 > 代码库 > iOS:获取图片Alpha图片

iOS:获取图片Alpha图片

-(void)createImages
{
    // Load the alpha image, which is just the same Ship.png image used in the clipping demo
    NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"Ship.png" ofType:nil];
    UIImage *img = [UIImage imageWithContentsOfFile:imagePath];
    _alphaImage = CGImageRetain(img.CGImage);
    
    // To show the difference with an image mask, we take the above image and process it to extract
    // the alpha channel as a mask.
    // Allocate data
    NSMutableData *data = http://www.mamicode.com/[NSMutableData dataWithLength:90 * 90 * 1];>