And conversion between px mm

Mm converted pixel 
conversion also need to know the other parameters: DPI (dots per inch) 
the number of pixels / DPI = Number inch 
inch = 25.4 mm Number * Number of 
the display device, whether it is a printer or a screen, there is a common the method 
first with the GetDeviceCaps (device handle, LOGPIXELSX) 
or 
the number of pixels per inch of the GetDeviceCaps obtaining apparatus (device handle, LOGPIXELSY) 
were recorded as: PX and py 
one inch equals 25.4mm 
then converted into millimeters formula for pixels 
in the horizontal direction in terms of: /25.4 x * px 
terms of the vertical direction: y * py /25.4 
pixels in terms of mm x * 25.4 / px 
in the program written so 
MyControl.Height: = 10 {mm} *  PixelsPerInch * 10 div 254;
numerators and denominators by 10, the floating-point integer arithmetic into operation, more efficient display parameters can be javascript 
screen. 
availHeight acquisition system work area of the screen height, Microsoft® Windows® taskbar excluded. 
availWidth get the work area the width of the screen system, excluding Windows taskbar. 
bufferDepth Gets or sets the number of bits per pixel for the outer screen bitmap buffer colors. 
colorDepth obtaining a target set of bits per pixel color or buffer. 
deviceXDPI set or get the value system screen horizontal dots per inch (DPI) of. 
Gets or sets the value deviceYDPI dots per inch (DPI) vertical screen system. 
fontSmoothingEnabled get the user whether rounding the corner of the screen fonts option is enabled in the Display Settings control panel. 
Get the vertical resolution of the screen height. 
logicalXDPI acquisition system screen horizontal dots per inch (DPI) of the conventional value. 
logicalYDPI acquisition system screen vertical dots per inch (DPI) of the conventional value. 
updateInterval set or get the update interval of the screen. 
Get the vertical resolution of the screen width. Standard resolution of 1024x768 or other commonly 800x600 dpi is calculated from a constant: 96, and therefore the relationship between the calculated pixel millimeters and also a constant approximately equal to: 
substantially  1 mm  is approximately equal to  3.78 pixels

Guess you like

Origin blog.csdn.net/qq_25131799/article/details/81312131