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.

GDI+ refresh image: very basic GDI+ question

Featured Replies

  • Commercial Member

Hi all,I've been programming analogue gauges for the past 2 years now and recently decided it was time to venture into the world of vector gauges.I downloaded Fred Clausens sample source and after some frustrating hours getting his code to work in MSVC6++ (had to add an include and redefine the ULONG_PTR variable) I was finally able to create a working gauge. i tried to make something very simple: an Ellipse that grows bigger and smaller based on Engine1 N1 (I created a local variable containing N1):case PANEL_SERVICE_PRE_DRAW:{ PELEMENT_STATIC_IMAGE pelement = (PELEMENT_STATIC_IMAGE)(pgauge->elements_list[0]->next_element[0]); if (pelement) { HDC hdc = pelement->hdc; PIXPOINT dim = pelement->image_data.final->dim; if (hdc) { Graphics graphics(hdc); Pen pen(Color(255, 0, 0, 255)); graphics.DrawEllipse(&pen, 100, 100, (int) N1_1, (int) N1_1); } SET_OFF_SCREEN (pelement); }}break;....OK, it's very basic but like I said it's a start. Now what happens is that FS2002 (my testbed) draws an ellipse that indeed increases and descreases size with N1 but... it doesn't clean up the previous draw ! I tried adding: Color blackColor(255, 0, 0, 0); graphics.Clear(blackColor);But this paints the whole area black and no ellipse can be seen anymore.This must be very basic stuff so, can anybody help me out here ?Thx for the help,Bj

simcheck_sig_banner_devteam.jpg

 

Bj

  • Author

Where exactly did you put the redraw? Put it at the very beginning before every other drawing is done and it should clean up everything just fine upon every drawing cycle. :-)Etienne :-wave

  • Commercial Member

Etienne,Belief it or not but it just dawned on me a few minutes ago that I was indeed clearing at the end of the drawing proces :-eek Man, my brain must have been damaged somewhere along the way...Thx for the help,Bj

simcheck_sig_banner_devteam.jpg

 

Bj

  • Commercial Member

I placed the Clear method in front of the drawing method and still nothing but a black canvas... strange !Bj

simcheck_sig_banner_devteam.jpg

 

Bj

  • Commercial Member

Alright this is what happens: The gauge draws fine with the clear event first but only when I load the panel after first loading a different panel. Also when I resize the FS2002 window the drawing doesn't show until i reload the panel again.Hope this makes sense to someone...Bj

simcheck_sig_banner_devteam.jpg

 

Bj

  • Author

Well, this sounds weirdo. *:-*Where did you put your initialization stuff? Try putting it into PANEL_CONNECT_TO_WINDOW.If nothing works, either ask or feel free to shoot me an eMail or PM.Good luck though, :-hahg'niteEtienne :-wave

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.