Sign in to follow this  
Guest mattreamy

Need Some GDI+ Help - Explanation from a previous post

Recommended Posts

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

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this