Sign in to follow this  
Guest JeanLuc_

Macros and drawing lines....and basic layout of a gauge

Recommended Posts

I have read the Panel SDK and I have a few questions.1) Can I draw a line using a generic function, instead of using the MAKE_STATIC macro and(gag me) using a bitmap?2) If the answer to question 1 is something like "Always use macros, there are no generic functions to draw primatives like lines, or the like", do I always need to use a bitmap or is there a way I can use drawing primatives? If I create a 744 like PFD with the compase rose on the bottom, will I need to have a circular bitmap that rotates around a point? I know the circular bitmap would be easier than using drawing primatives, but that is just an example 3) In a gauge file...how would I go about laying down the 'framework' so that I can update variables, redraw bitmaps and(hopefully) drawing primatives and the like? Do macros always redraw themselves everytime the panel is updated?Thanks a bunch for any help you can give me!!

Share this post


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

1) The only way to do this would be to make a vector gauge. Vector gauges are drawn using the windows api instead of gauge macros. You have to have a black background and draw all of the elements of the gauge using the primitives. Obviously, this is much more difficult than using the macros. Download Dai Griffith's gauge tutorial. It has some examples of vector gauges with it.2) Just like you said, you would need to have a circular card that rotates around the center. Unless you're doing some heavy-duty gauge programming, for the most part just stick with the macros.3) The macros will automatically redraw whenever the panel is updated. If you tell the element macro which variable it should reference, it will automatically refresh that variable and draw the correct value. If not, you will have to use an Element Callback and tell the gauge what value to use for the redraw.You can see all of the bitmaps that go into a gauge here: http://www.flightsimnetwork.com/dcforum/DCForumID3/7049.htmlHope this helps! ;)Matt

Share this post


Link to post
Share on other sites

Matt --Thanks a bunch!! That answer my questions perfectly. I downloaded that tutorial you mentioned and I have looked at the WinAPI GDI, and I am going to have my work cut out for me!!Thanks a bunchFred

Share this post


Link to post
Share on other sites

Hi Fred,the new SDK provides a IMAGE_CREATE_DIBSECTION flag for helping out things.Hope it helps!

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