One Quickie


Creating a CGImageMask from a UIImage (Graphics->General)
- (CGImageRef) newMaskFromImage: (UIImage *) image {
    CGImageRef maskRef = image.CGImage;
    CGImageRef mask2 = CGImageMaskCreate (CGImageGetWidth (maskRef),
                                          CGImageGetHeight (maskRef),
                                          CGImageGetBitsPerComponent (maskRef),
                                          CGImageGetBitsPerPixel (maskRef),
                                          CGImageGetBytesPerRow (maskRef),
                                          CGImageGetDataProvider (maskRef),
                                          NULL, NO);  // provider, shouldInterpolate
    return mask2;
} // newMaskFromImage



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com