Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to draw a bitmap with Alpha values preserved in CGContext?




On 29 Jun 2006, at 14:26, Scott Thompson wrote:

I know how to do this with QT not sure how to do this with.... CG

Last time I looked there was no way to get Quartz to draw with straight alpha , only premultiplied. You can use vImage to unpremultiply the pixels.

I don't believe this is the case. I should write some code to check it, though.


Part of the information you supply to a bitmap context when you create it is the alpha channel behavior you desire. At that point you can specify whether or not you want the context to contain premultiplied or "straight alpha" pixels. Do you really get premultiplied even if you ask the context for straight alpha?

It's been some time since I tried this, but I believe that CGBitmapContextCreate just returns NULL if you try to create one with, say, kCGImageAlphaFirst.


Jerry

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden
References: 
 >QTKit or Quicktime API for frame analysis (From: "Kevin" <email@hidden>)
 >How to draw a bitmap with Alpha values preserved in CGContext? (From: Marc Van Olmen <email@hidden>)
 >Re: How to draw a bitmap with Alpha values preserved in CGContext? (From: Marc Van Olmen <email@hidden>)



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.