in reply to Tk screen and monitor size in mm, DPI and scaling
G'day Discipulus,
I don't believe I've ever used either of those mm methods; and I don't think I've used mm sizes for specifying widths, padding, etc. Except for character sizes for a few text-based widgets, I always gone with pixels. Anyway, I was curious and do seem to have a similar issue to what you describe. Here's the output from the test code you posted:
screen name :0.0 pixel width 2560 pixel height 1440 scaling 1.33398982438864 mm width 677 mm height 381
I have Perl 5.32 and Tk 804.035 running on a Cygwin/Win10 OS. The system (Win10 Settings) reports 2560x1440; I'm pretty sure that's accurate. The manufacturer's spec gives the monitor width as 27" — I wonder if that's the physical size (i.e. includes the housing surrounding the useable/viewable part of the screen).
Those numbers would give me a DPI of 94.8148148148148 (2560/27); and, factoring in the scaling, a point size of 1/71.0761154855644" (not the expected 1/72").
I don't know how the mm sizes are determined. I had a look in https://github.com/eserte/perl-tk/blob/master/Tk/Widget.pm but couldn't see anything useful there; it's probably hidden away in XS code somewhere.
I also had a look in "Active bugs for Tk". I didn't see anything relevant but, with 140 outstanding issues, it's not impossible that I missed something. It may be worth raising a bug report.
I don't use PowerShell but I do have it available. I tried your Get-WmiObject command, both as a normal user and as Administrator, and got the same error:
PS C:\WINDOWS\system32> Get-WmiObject -Namespace root\WMI -ComputerNa +me localhost -Query "select InstanceName, MaxHorizontalImagesize, Max +vwerticalImageSize from WmiMoninitorBasicDisplayParams" Get-WmiObject : Invalid class "WmiMoninitorBasicDisplayParams" At line:1 char:1 + Get-WmiObject -Namespace root\WMI -ComputerName localhost -Query "s +e ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~ + CategoryInfo : InvalidType: (:) [Get-WmiObject], Manage +mentException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.Powe +rShell.Commands.GetWmiObjectCommand
I, too, was a little surprised at the scaling value. The system (Win10 Settings) reports scaling of 100%; not 133.398982438864%.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk screen and monitor size in mm, DPI and scaling
by Discipulus (Canon) on Mar 14, 2021 at 20:47 UTC |