Visual C + + PRINT programming technology-programming Basics-mapping mode

Source: Internet
Author: User

Mapping mode:

The coordinate mapping used in Visual C + + makes the user graphics coordinates exactly the same as the output setting.

Eg: when the screen has a pixel size of 800x600, each inch contains a screen pixel of 96, and the printer needs several points to achieve the same logical size

Therefore, the coordinate mapping method can be converted, which means that the proportion of coordinates used by the printer is several times larger than that of the display.

Mapping mode: When drawing on a screen or printer, you can use inches or millimeters instead of as units (instead of pixels), which is often more intuitive.

PS: Device unit, logical unit

Device units: is the x and Y values passed to the drawing function, they can represent inches and millimeters

Logical units: x, y pixels on the screen, or the number of dots on the printer.

Click on the mouse to return to device units, if you want to know where the mouse click on the bitmap location, you need to convert device units into logical units.

Available mapping modes
Mapping mode Logical units
Mm_text 1px
Mm_lometric 0.1mm
Mm_himetric 0.01mm
Mm_loenglish 0.01 inch
Mm_hienglish 0.001 inch
Mm_twips 1/1440 inch
Mm_isotropic User-defined value, but the X and y directions are equal (equal)
Mm_anisotropic User-defined values, but the X and Y directions are arbitrary

The mapping mode is set by a member function Setmapmode () of the device environment class, as long as the above flag is passed as a parameter to the function. When mapping mode is set, the coordinate values passed to any drawing function are converted to device coordinates through the mapping mechanism inside GDI.

Ps:mm_text mode, the positive direction of the y-axis is perpendicular to the screen, and the x-axis is along the screen to the right

In other modes, the y-axis is vertically upward along the screen, and the x-axis is along the screen backwards

Visual C + + PRINT programming technology-programming Basics-mapping mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.