Mfccdc Demonstrates Viewport and Mapmode Use in MFC (195028)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q195028 NOTE: Microsoft Visual C++ .NET (2002) and Microsoft Visual C++ .NET
(2003) support both the managed code model that is provided by the .NET
Framework and the unmanaged native Windows code model. The information in this
article applies to unmanaged Visual C++ code only. 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()
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.
Modification Type: | Minor | Last Reviewed: | 8/9/2004 |
---|
Keywords: | kbfile kbGDI kbhowto KB195028 kbAudDeveloper |
---|
|