M
M
mrgloom2014-05-27 17:21:40
C++ / C#
mrgloom, 2014-05-27 17:21:40

How to translate MFC from logical to physical coordinates?

Suppose there is a text that is specified by the LOGFONT
structure. It is written that it is specified in logical units, as I understand it, only the mapping mode affects the transfer from logical to device, and it is also possible to shift the coordinates, i.e. if I don't apply anything then logical unit= device unit?
And what should I do if I use the mapping mode, for example, I compressed Y by 2 times, how can I then pull out this information when choosing a font size?
I draw directly on a 1:1 image, which I then save to a file and I need to set the text height in % of the image height.
And how is this formula explained?

lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);

It is still not clear what is meant bydc.GetDeviceCaps(LOGPIXELSY)
LOGPIXELSY
Number of pixels per logical inch along the screen height. In a system with multiple display monitors, this value is the same for all monitors.

What means
Number of pixels per logical inch

What is logical inch? Aren't logical coordinates abstract?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question