On Jan 30, 2007, at 4:14 PM, Steve Christensen wrote:
Yes. For alpha, I'd like to be able to make changes relative to an
arbitrary current context alpha setting, i.e., CGContextSetAlpha
(theContext, CGContextGetAlpha(theContext) * 0.5) -- assuming a
CGContextGetAlpha function existed.
If you do this, you'll get the alpha double counted. Whatever alpha
you set for the context is automatically calculated into further
drawing operations on the context, including those that include
alpha drawing. So the effective alpha of any drawing operation is
pixelAlpha * contextAlpha.
I'm not sure I understand the double counting part, but I understand
that once an operation has been performed on a context that the
resulting pixels take into account the pixel's previous alpha value
as well as that of the context's alpha. All I'm saying is that I'd
like to be able to do things like this:
In this case, I'd expect to see a rectangle drawn at half the current
context alpha. I might have, for example, just drawn an image at an
arbitrary alpha on top of some background, then wanted to draw a
border at half that alpha.
I could obviously just carry around an alpha value to be used for all
the drawing and then use that for calculating relative alpha values.
But since the context must already know what its current alpha value
is, it seems reasonable to be able to just ask when needed.
steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden