Recent

Author Topic: How do you get pixels per millimeter in linux?  (Read 1153 times)

jianwt

  • Full Member
  • ***
  • Posts: 164
How do you get pixels per millimeter in linux?
« on: January 16, 2023, 01:24:37 pm »

Google Translate

Novice seeking advice
In windows, you can use GetDeviceCaps(Frm.Canvas.Handle, LOGPIXELSX) * 10/254 to get the pixel width per millimeter.

So how do you get pixels per millimeter in linux?

wp

  • Hero Member
  • *****
  • Posts: 13487
Re: How do you get pixels per millimeter in linux?
« Reply #1 on: January 16, 2023, 01:41:40 pm »
ScreenInfo.PixelsPerInchX and .PixelsPerInchY in unit Graphics, or Screen.PixelsPerInch or Monitor.PixelsPerInch in unit Forms.

jianwt

  • Full Member
  • ***
  • Posts: 164
Re: How do you get pixels per millimeter in linux?
« Reply #2 on: January 16, 2023, 02:22:36 pm »
Thank you very much。

Thaddy

  • Hero Member
  • *****
  • Posts: 18972
  • Glad to be alive.
Re: How do you get pixels per millimeter in linux?
« Reply #3 on: January 16, 2023, 04:37:36 pm »
pixels per inch are not pixels per millimeter.
Pixels per Centimeter: pixelsperinch/2.54
Pixels per MilliMeter:   pixelsperinch/25.4
« Last Edit: January 16, 2023, 04:41:50 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

wp

  • Hero Member
  • *****
  • Posts: 13487
Re: How do you get pixels per millimeter in linux?
« Reply #4 on: January 16, 2023, 04:45:57 pm »
Thaddy, it is clear from the first post that the OP knows how to convert inches to millimeters.

wyattwong

  • Newbie
  • Posts: 6
Re: How do you get pixels per millimeter in linux?
« Reply #5 on: January 16, 2023, 05:48:16 pm »
Thank you

 

TinyPortal © 2005-2018