Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Vector gauge programming

Featured Replies

It's been a while since I did any proper gauge/module coding.(FS98 days ... )What is the best way to code vector based gauges?DirectDraw?I saw someone mention GDI+ - is that the new/better way of drawing vector gauges?Are there any tutorials/samples somewhere that will save me some headaches?ThanksPaul

Hey Paul,XML is the easier language, C is the harder to learn, more powerful language (plus much harder for someone to see the code).In C, GDI+ is probably your best bet, although I have only tried GDI as another option. Between the two, I pick GDI+ any day of the week and twice on Sundays. GDI+ is faster, offers antialiasing without slowing down (GREAT asset), gradient brushes, and an alpha value for any color (so anything can be semi-transparent). It is also much more straight forward to use than GDI as far as pens and brushes.By the way, what Jan is doing in that post is mostly just stripping away things from the stock GPS, not sure he is using XML to draw new vectors, although he may for the range rings. I have heard, but not seen, that there is new technology in XML that allows vectors (have not seen because it seems the stock GPS actually calls C funcitons to draw the vectors). But apparently there is no antialiasing for XML, and that, believe me, makes all the difference.No tutorials, it seems, although you can get a file here at AVSIM by Fred Clausen on how to startup GDI+ in your C code, and learn pretty much everything about GDI+ at MSDN at http://msdn.microsoft.com/library/en-us/gd...lus/GDIPlus.asp

Thanks Fabio, that's what I was looking for.XML is not powerful enough for what I want to do so C++ is what I'll be using.Also my gauge code needs to be hidden even though it will be freeware.It's for competition flying and I don't want people to be able to hack it easily and cheat in the competitions.Paul

Hi,Between accolades, in the "new" xml you can draw very easily rectangles, circles, lines, polygons, polylines etc. and let them move, shift and rotate with the "old" commands.All those figures you can fill with colors and outline them with others etc.And that is what i do. A lot of fun (rebuilding my gauges); many bitmaps can be replaced that way and things look definitely more real.Jan"Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Yes, there definately is an advantage to using the new XML gauges but can they play sounds, do file/disk IO, socket comms, inter-process comms, data encryption, etc?Some things have to be done the "hard" way. :)Paul

Hey Jan,Ah, excellent, so it is possible to do thise in XML, very good! This should allow future developments in this area to be very exciting!Thanks for the info,

Hey Paul,I sent you an e-mail through the Avsim e-mail system, see if you got it.

  • 3 months later...
  • Commercial Member

Jan,In playing with vector gauges in XML, have you discovered if there is any way to circumvent the anti-aliasing against the scenery? With bitmaps (and so far in playing with vectors) I always get anti-aliased artifacts when trying to simulate a HUD. This includes text which is over 18 point. Anything drawn aganst the sky and then rotated looks horrible, with darker colored artifacts around the edges.Also, In looking at the GPS commands used, I see Polyline, Rectangle and Polygon commands. Is there one for a regular line and/or a circle? If so, do you know what the parameters look like?Thanks--Jon

Hi,No experience with HUD etc.Gives a line at point x=-10, 7 pixels long.Gives a circle with radius of 75 pixels.You can add the commands:Backgroundcolor="#......" or Fillincolor="0x......"etc. etc.Jan"Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Commercial Member

Ah, that's great. I should be bale to do lots of interesting things those. I guess there's no way to prevent FS9 from anti-aliasing bitmaps and vectors against the outside world, so I'll just have to try and adjust the colors depending on the time of day...Thanks again, Jan--Jon

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.