Presentation is loading. Please wait.

Presentation is loading. Please wait.

Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10.

Similar presentations


Presentation on theme: "Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10."— Presentation transcript:

1 Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10

2 Dynadata Software Development with MFC Library
Copyright, 2014 © DynaData S.A. 2/10

3 Dynadata The Mapping Mode
MFC supports two kinds of coordinate systems. One is Device Coordinate and the other one is Logical Coordinate. In device coordinate we specify everything in terms of pixels. In logical coordinate we measure each unit in terms of Metric standard or British standard. How each unit maps to the logical measure is called the mapping. We can specify the mapping using the mapping modes. Dynadata Copyright, 2014 © DynaData S.A. 3/10

4 Dynadata The Mapping Mode
The mapping modes are useful to perform the real world drawing needs to represent how a single drawing unit measures to the real world measuring standards. MFC supports eight mapping modes Dynadata Copyright, 2014 © DynaData S.A. 4/10

5 Dynadata The Mapping Mode
The mapping mode defines the unit of measure used to convert logical units to device units; it also defines the orientation of the device’s x- and y-axes. The coordinate mapping mechanism involves defining two rectangles: the window, which defines a rectangle in the logical coordinate space, and the viewport, which defines a rectangle on the destination device. Dynadata Copyright, 2014 © DynaData S.A. 5/10

6 The Mapping Space Dynadata Copyright, 2014 © DynaData S.A. 6/10

7 The Mapping Space Dynadata Copyright, 2014 © DynaData S.A. 7/10

8 The Mapping Mode Types I
On the MM_TEXT mapping mode, the positive X moves from the default top left corner origin, to right side. MM_ISOTROPIC and MM_ANISOTROPIC have user defined coordinate system. In MM_ISOTROPIC both x and y units are measured equally. But in the MM_ANISOTROPIC mode X and Y can have different units of measure. The MM_TEXT mapping mode is the default mapping mode used by MFC. The SetMapMode(); function change the mapping mode on the Device Context. Dynadata Copyright, 2014 © DynaData S.A. 8/10

9 The Mapping Mode Types I
GDI uses the mapping mode to convert logical coordinates into the appropriate device coordinates. The default mapping mode is MM_TEXT. MM_ANISOTROPIC Logical units are converted to arbitrary units with arbitrarily scaled axes. Setting the mapping mode to MM_ANISOTROPIC does not change the current window or viewport settings. MM_HIENGLISH Each logical unit is converted to inch. Positive x is to the right; positive y is up. MM_HIMETRIC Each logical unit is converted to 0.01 millimeter. Positive x is to the right; positive y is up. MM_ISOTROPIC Logical units are converted to arbitrary units with equally scaled axes; that is, 1 unit along the x-axis is equal to 1 unit along the y-axis. Dynadata Copyright, 2014 © DynaData S.A. 9/10

10 The Mapping Mode Types II
MM_LOENGLISH Each logical unit is converted to 0.01 inch. Positive x is to the right; positive y is up. MM_LOMETRIC Each logical unit is converted to 0.1 millimeter. Positive x is to the right; positive y is up. MM_TEXT Each logical unit is converted to 1 device pixel. Positive x is to the right; positive y is down. MM_TWIPS Each logical unit is converted to 1/20 of a point. (Because a point is 1/72 inch, a twip is 1/1440 inch.) Positive x is to the right; positive y is up. The mapping mode functions are: SetMapMode(), SetWindowExt(), SetViewportExt(), SetWindowOrg(), SetViewportOrg(), LPtoDP(), and DPtoLP(). The default mapping mode is MM_TEXT. Dynadata Copyright, 2014 © DynaData S.A. 10/10


Download ppt "Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10."

Similar presentations


Ads by Google