Have you compared these results with what X11 gives you? (I know Windows is not X11 but you can have a simple X11 server by using something like MobaXterm on Windows).

use strict; use warnings; eval { use X11::Protocol; # Screen dimensions my $x11 = X11::Protocol->new (); my $screen = ($ENV{DISPLAY}//":0.0") =~ m/\.(\d+)$/ ? $1 : 0; $x11->choose_screen ($screen); # Root window printf "Screen is %4d x %4d x %2d pixels (%3d x %3d mm) (X11)\n", $x11->{width_in_pixels}, $x11->{height_in_pixels}, $x11->{root +_depth}, $x11->{width_in_millimeters}, $x11->{height_in_millimeters}; }; eval { use Tk; my $mw = Tk::MainWindow->new; printf "Screen is %4d x %4d x %2d pixels (%3d x %3d mm) (Tk)\n", $mw->screenwidth, $mw->screenheight, $mw->depth, $mw->screenmmwidth, $mw->screenmmheight; };
$ screen_size Screen is 3840 x 1200 x 24 pixels (1014 x 317 mm) (X11) Screen is 3840 x 1200 x 24 pixels (1014 x 317 mm) (Tk)

Enjoy, Have FUN! H.Merijn

In reply to Re: Tk screen and monitor size in mm, DPI and scaling by Tux
in thread Tk screen and monitor size in mm, DPI and scaling by Discipulus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.