October 22, 200520 yr 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
October 22, 200520 yr 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
October 22, 200520 yr 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