Jump to content

Sign in to follow this  
Guest mattreamy

Need Some GDI+ Help - Explanation from a previous post

Recommended Posts

Guest mattreamy

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

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
Guest mattreamy

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...