SAMPLE: Mfccdc Demonstrates Viewport and Mapmode Use in MFC

ID: Q195028


The information in this article applies to:


SUMMARY

The Mfccdc sample demonstrates how to set the Mapmode, Viewport, and Window parameters, and draws a rectangle based on given logical coordinates; then, the sample calculates the resulting device units.

The sample shows how to use the following functions:


   SetMapMode()
   SetWindowExt()
   SetViewportExt()
   SetWindowOrg()
   SetViewportOrg()
   LPtoDP()
   NormalizeRect() 


MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

Mfccdc.exe
Release Date: SEP-10-1998
For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services

Steps to Run the Sample

Once the sample is running, parameters to the above-mentioned functions can be changed in a dialog box, which effectively updates the rectangle and the calculated device units.


REFERENCES

VC Online help - "CDC class members" and "Converting from Device Coordinates to Logical Coordinates."

Charles Petzold's book, "Programming Windows," ISBN 1-55615-264-7.

Additional query words: kbDSupport mapmode viewport MM_ISOTROPIC MM_ANISOTROPIC MM_LOENGLISH MM_HIENGLISH MM_TWIPS MM_TEXT


Keywords          : kbfile kbMFC kbVC400 kbVC410 kbVC420 kbVC500 kbVC600 
Version           : WINNT:4.0,4.1,4.2,5.0,6.0
Platform          : winnt 
Issue type        : 

Last Reviewed: August 5, 1999