Durango wrote:
The archives have lots of info on issues with bevel buttons and
icons,
but no one has mentioned the symptom I'm seeing.
Everything works fine on PPC. On Intel my bevel buttons with PICT
resources are ignoring the alpha channel. Where alpha is zero, I just
get a default gray background--which isn't even the proper control
color I've set. Doesn't really seem like a byte-swap issue, but it's
definitely Intel-only.
QD doesn't really support an alpha channel, and although you can put
32-bit pixels into a PICT the alpha byte isn't meaningful.
Historically QD has let you get away with keeping data in those
bytes -
but only in so far as it won't generally trash it outright.
I suspect on Intel there's some point inside QD where those undefined
bytes are being normalised as they pass through, so you end up losing
that information.
There are hundreds of button images to deal with in this app, so I'm
looking for a way to avoid having to convert all of them to another
format.
I guess I can use a kEventControlDraw handler and draw the PICT
myself, but that doesn't help if the alpha handling bug remains.
If you can successfully get the alpha channel out of your PICT data on
Intel, then you could use kEventControlDraw to override the normal
drawing path (creating a CGImageRef out of the 32-bit pixels in the
PICT
data, then draw that vs drawing the PICT directly).
If the alpha is mangled when the PICT is loaded, you might need to
write
your own loading code too.
In the longer term, you could convert them all to .png and use
CGImageCreateWithPNGDataProvider to get a CGImageRef for the button.