Sign in to follow this  
Guest HartmannH

Transparent GDI gauges

Recommended Posts

I don't know if this has been poszted before, but you might know that C gauges can't use transparent GDI drawing (IMAGE_CREATE_DIBSECTION leads always to non-transparency, however the "old" way of GDI drawing, i.e. bitwise copy to the image buffer, might work with transparency). So e.g. HUDs with GDI are impossible with C gauges. XML gauges however can use the "CustomDraw" elements, and their black (RGB(0,0,0)) parts are transpararent, therefore XML gauges can use transparent GDI drawings for HUDs and similar. "All" you need to do, is to program a "C to XML" module DLL described in this topic:http://forums.avsim.net/dcboard.php?az=sho...id=21558&page=3Arne Bartels

Share this post


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

I have tried to achieve transparency in connection with GDI+ for ages with no success. Thanks for the hint. :-hahBye :-beerchugEtienne :-wave

Share this post


Link to post
Share on other sites

Well, the C++ part is easy but how to do the XML part? I'm a total newbie when it comes to XML gauges. Could anybody give me a hint how a basic XML HUD gauge which uses Arne's code would look like? My problem are not so much the CustomDraw tags but more the structure of the gauge.Oh and yes, I need this one to build the HUD for a guy from the UK who wants to use it in a home cockpit (college project), so it's not a payware project.Thanks a lot.

Share this post


Link to post
Share on other sites

A very basic display of my mentioned GDI drawings from module DLL would be:(A:AIRSPEED TRUE,knots)(A:ATC ID,string)Fixed vars can be in the Tag e.g.:(A:AIRSPEED TRUE,knots)Arne Bartels

Share this post


Link to post
Share on other sites

Works perfect. Thanks a lot.Seems that it's about time that I take a closer look at XML gauges ;-)

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