Jump to content
Sign in to follow this  
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


simcheck_sig_banner_devteam.jpg

 

Bj

Share this post


Link to post
Share on other sites

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


simcheck_sig_banner_devteam.jpg

 

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


simcheck_sig_banner_devteam.jpg

 

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


simcheck_sig_banner_devteam.jpg

 

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...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...