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.

Need Some GDI+ Help - Explanation from a previous post

Featured Replies

I found this example on the post located:http://forums.avsim.net/dcboard.php?az=sho...15387&mode=fullcase PANEL_SERVICE_PRE_DRAW: pelement = (PELEMENT_STATIC_IMAGE)(pgauge->elements_list<0>); if (pelement) { HDC hdc = pelement->hdc; PIXPOINT dim = pelement->image_data.final->dim; if (hdc) { SetMapMode (hdc, MM_ANISOTROPIC); SetWindowExtEx (hdc, 200, 200, NULL); SetViewportExtEx (hdc, dim.x, dim.y, NULL); //Paint here SET_OFF_SCREEN(pelement); } }break;Could someone explain to me the parameters in the lines below: SetMapMode (hdc, MM_ANISOTROPIC); SetWindowExtEx (hdc, 200, 200, NULL); SetViewportExtEx (hdc, dim.x, dim.y, NULL);I'd appreciate it. Thanks

  • Moderator

My best guess, following from the context of the discussion where this was posted, is that it is a method that eliminates the need to use "scaling factors" (scalars) such as dx and dy explicitly whenever the gauge is resized.I would assume that the numbers in this: SetWindowExtEx (hdc, 200, 200, NULL);would be the absolute size of your DIBSECTION bitmap in pixels. SetViewportExtEx (hdc, dim.x, dim.y, NULL);would obtain dim.x and dim.y from the "Viewport" (size on screen) SET_OFF_SCREEN(pelement);at the end of your drawing code will force a redraw of the gauge elements at the new size.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Thanks, Bill,Once again, you've been an enormous help to my understanding of these things. I truly appreciate your help.

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.