| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On May 11, 2006, at 7:28 PM, Peter Bates wrote:
You might also be able to get away with CGImageCreateCopyWithColorSpace IF the image doesn't have any alpha (I don't believe JPEG images do). Or you can redraw the masking image into a CGBitmapContext with the appropriate color characteristics (8 bit per pixel, DeviceGray) and then use CGImageMaskCreate to create an image mask from the resulting bitmap. ( Also, if you are on Tiger you could also simplify your code a bit by using Image I/O and CGImageSourceCreateWithURL: NSURL *k9TeethImageURL = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForImageResource:@"MyImage.png"]]; CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef) k9TeethImageURL); CGImageRef k9TheethImage = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL); CFRelease(imageSource); I typed the code sample into Mail so it may take a little finessing ) As someone new to Quartz, may I suggest my introductory text: Or David Gelphman's more comprehensive tome: Both of which cover masking of images at their respective levels. Scott |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden This email sent to email@hidden
| References: | |
| >Difficulty masking an image with another image (From: Peter Bates <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.