| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hi,
I'm wanting to create a CGImageRef from a CGBitmapContextRef - which is pretty straight forward. However, I'm having a bit of a problem...
I want to use an alpha channel but I'm only getting good results by not using an alpha channel.
Basically I'm doing this:
CGContextRef context = ::CGBitmapContextCreate( ... basic info..., theAlphaInfo );
CGImageRef image = ::CGImageCreate( ... basic info from context ...,
dataProvider, null, true,
kCGRenderingIntentDefault );
The "basic info" is block of data that assumes 32 bits per pixel. The colorspace is CGColorSpaceCreateDeviceRGB
The "basic info from context" are the CGBitmapContextGet... calls. The dataProvider is created with the block of data used to create the context.
When theAlphaInfo is kCGImageAlphaPremultipliedFirst (or last), drawing the image into a context with a size other than the image's size will sometimes produce garbage on the screen, sometimes it will produce results that suggest that the row bytes is wrong.
When theAlphaInfo is kCGImageAlphaNoneSkipLast (32bits per pixel), the drawing lacks the alpha channel but it always draws right.
Thoughts?
I'm still using 10.3
Mark
_______________________________________________ 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: | |
| >A Tail of Two Bitmaps (From: Mark Morrill <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.