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 Problems - FS2002

Featured Replies

I am experimenting and/or trying to learn how to use the vector interface when making panel gauges for FS2002. Could someone take a look at the following code and tell me if I'm doing something wrong?void FSAPI EicasOneCallback(PGAUGEHDR pgauge, SINT32 service_id, UINT32 extra_data){ // Determine service call switch(service_id) { // Pre-draw routine case PANEL_SERVICE_PRE_DRAW: { // Get a drawing surface and confirm its existance PELEMENT_STATIC_IMAGE pElement = (PELEMENT_STATIC_IMAGE)(pgauge->elements_list[0]->next_element[0]); if(pElement) { // Get a drawing mechanism and determine its existance HDC hDraw = pElement->hdc; if(hDraw) { // Create brush and pen HBRUSH hbrush = CreateSolidBrush(RGB(255,0,0)); HPEN hpen = CreatePen(PS_SOLID, 4, RGB(0,255,0)); // Setup colors SelectObject (hDraw, hbrush); SelectObject (hDraw, hpen); // Draw and finish Rectangle(hDraw, 40, 40, 80, 80); REDRAW_IMAGE(pElement); } } // Break break; } }}I appreciate any suggestions, please help.-Matt

How is your drawing element structure? An MAKE_STATIC placed on the background MAKE_STATIC or do you try to draw directly on the background MAKE_STATIC with the GDI routines?For the first case you have to usePELEMENT_STATIC_IMAGE pElement = (PELEMENT_STATIC_IMAGE)(pgauge->elements_list&l;0&r;->next_element&l;0&r;);for the second case:PELEMENT_STATIC_IMAGE pElement = (PELEMENT_STATIC_IMAGE)(pgauge->elements_list&l;0&r;);Arne Bartels

Arne,I am using the first case in which I am drawing on a second macro layed on top of the background. They are configured as follows://///////////////////////////////////////////////////////////////////////////// SurfaceMAKE_STATIC ( eicas1_surface, IMG_EICAS1_SURFACE, eicas_1_fail, NULL, IMAGE_USE_ERASE | IMAGE_CREATE_DIBSECTION, 0, 0,0)PELEMENT_HEADER eicas_surface_list[] ={ &eicas1_surface.header, NULL};/////////////////////////////////////////////////////////////////////////////// BackgroundMAKE_STATIC ( eicas1_background, IMG_EICAS1_BACKGROUND, NULL, eicas_surface_list, IMAGE_USE_TRANSPARENCY, 0, 0,0)PELEMENT_HEADER eicas1_list = &eicas1_background.header;The drawing surface bitmap is an 8-bit for maximum compatibility and the drawing code mentioned in the very first message remains unchanged including the PELEMENT_STATIC_IMAGE declaration. Any further ideas?-Matt

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.