Archived

This topic is now archived and is closed to further replies.

n4gix

Alpha-channel how-to -> can anyone explain ?

Recommended Posts

Hi all,Can anyone explain how I should implement alpha-channel shading in my gauges ?I know how to draw an image with an alpha-channel in PSP and run that through the imagetool from MS, its the bit after that that I don't seem to get right. Basically I want to add some shading to a few of my C++ indicator gauges and add a transparent protection to one of the switches. These gauges consist of a STATIC (off course), a few icons and needles etc... and I want to layer an ICON element on top of that containing the alpha-channel based shading.I added the IMAGE_USE_ALPHA flag to the ICON element but the result is completely not what I had intended. Although the alpha looks really nice in imagetool , when I add it to the gauge it basically results in either 100% black or 100% transparent.Does anyone have experience with this ?Thx,Bj

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi BjornIt's already in the next version of sd2gau. I was holding off releasing it until I'd finished the DirectSound stuff but that may take some time yet (the usual shortage of time!), so I'll get a new version out this week.-Dai

Share this post


Link to post
Share on other sites

Thx Dai,I read what you mentionned in the current version but frankly... it doesn't make too much sense, at least it doesn't for me ;)Looking forward to the new release (as always !).Bj

Share this post


Link to post
Share on other sites

Ooops.... did I already release the alpha channel stuff? I don't keep track of which date I released what version on. The update list is just that; the day I updated/entered any new information.What parts don't make sense? Maybe I can improve it.-Dai

Share this post


Link to post
Share on other sites

Dai,I've re-read the v.24 (p.76) text and I will try using a static element in stead of an ICON for the alpha channel stuff and see if that works any better. The NEEDLE example in v.24 seems to indicate that alpha channels don't really work in other than STATIC elements, have you tried using an ICON with alpha channel ?Thx,Bj

Share this post


Link to post
Share on other sites

Caught. The very first time I make an assumption in the sd2gau series I get caught. Where's the justice in that? :-lol No, I didn't try MAKE_ICON; I assumed that it would most likely work if the icon only had a single bitmap that was switched permanently on. If you are using a single-bitmap MAKE_ICON, then there is no reason why you couldn't change it for MAKE_STATIC. I guess that when I have the time I should run a set of tests to see if the alpha channel will work with a multi-image MAKE_ICON.-Dai

Share this post


Link to post
Share on other sites

Dai,Tried it and it only really works with STATIC elements. I did find a problem with poor refresh rates of the static image so you will have to add the IMAGE_USE_ERASE flag also, but other than that it works really well.Bj

Share this post


Link to post
Share on other sites

Actually, that makes sense, because we can only use an Alpha mask on static (non-moving) elements using XML as well...

Share this post


Link to post
Share on other sites