Home > Back-end >  According to the PixelsPerInch to set the physical size is not correct?
According to the PixelsPerInch to set the physical size is not correct?

Time:09-21

I want to let the user to specify number of cm to display an image. Small but displayed in the window, took no 4 cm
The core code is as follows:
Double pixelPerCM=this - & gt; PixelsPerInch/2.54;//get the pixel per cm
ImageList1 - & gt; Width=m_width * pixelPerCM;
ImageList1 - & gt; Height=m_height * pixelPerCM;

M_width and m_height is 4, but the screen is 4 cm can be poor

CodePudding user response:

Different display, how different pixel spacing distance or broken?

CodePudding user response:

Use GetDeviceCaps LOGPIXELSX and LOGPIXELSY conversion,

CodePudding user response:

refer to the second floor DelphiGuy response:
with GetDeviceCaps LOGPIXELSX and LOGPIXELSY conversion,


LOGPIXELSX: every logical inch along the screen width sizes, in a multi-monitor system, display the value of the same;
LOGPIXELSY: height per logical inch along the screen sizes, in a multi-monitor system, display the value of the same;

Logical inch, is equal to the actual amount of inches?

CodePudding user response:

Not necessarily equal, to support the DDC/CI, E - EDID monitor, the operating system can obtain the parameter information, so the data should be accurate, for display more early, is certainly no, Windows assumes that the display is 72 dpi (I was), basically since the late 90 s did not monitor,

  • Related