Sign in to follow this  
Guest luhiss

GDI Vector gauges in VC - help enclosed

Recommended Posts

Hi,I have enclosed a "little help" for all programmers out there, who want to use their GDI Vector gauges in the VCs of FS2002. It is based on the FlightMap source from the MS panel SDK, with some changes and comments from me :-cool Chris Koegler

Share this post


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

Hey Chris.Thank you very much for this example. I have tried it with the GDI+, but ran into problems.I have added the following to my code:hrgnDraw = CreateRectRgn( 0, 0, dim.x, dim.y);// create a rect. regionbefore the function that draws my gauge, thenInvertRgn(pelement->hdc, hrgnDraw);//we invert the colors of the rect region hereBitBlt( pelement->hdc, 0, 0, dim.x, dim.y, hdc, 0, 0, PATINVERT );right after the function, and before SET_OFF_SCREEN (pelement);All of this is in PANEL_SERVICE_PRE_DRAWAnd in the beggining of my code, right after the header, I have includedHRGN hrgnDraw;I do not, however, have the if (hrgnDraw) before I draw the function, for I am not sure what it protects against. I believe it would protect against the Region not being initialized, but I don't see why it wouldn't.The problem is the gauge does not show up. I added it just like I would any other gauge, to the C172 VC, but see nothing.Oh well, I am stepping into unkown territory here. Just wanted to see if I was doing it right, and if this should work with GDI+.

Share this post


Link to post
Share on other sites

Hi Fabio,I do not use BitBlt for my GDI+ gauges, because there is another way to make them work in VCs, but I have tried it now with one of my GDI+ gauges, and it works fine for me. Maybe there is a difference in the way you write the GDI+ stuff, but normally it should work.Chris

Share this post


Link to post
Share on other sites

Hi Chris. I've been following these threads with a lot of interest!You say there is another way? Can you explain?Thanks!Luhiss

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