Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thanks a lot vr for clarifications,

> for those who strive to work in mm

I think I will be no more in that number. it really seems too complicated to be sure of an exact measure in mm. It seems pixel are always accurate so I'll use pixels only.

As always I must confess I make a lot of confusion with this matter and discovered about EDID today from your post. It seems EDID data in windows is concealed in the registry under HKLM\SYSTEM\CurrentControlSet\\Enum\DISPLAY\"name of your monitor"\Device Parameters\EDID key.

I installed Parse::EDID and arranged the following:

use strict; use warnings; use Parse::EDID; use Data::Dumper; # I have two similar keys: PHLC0E5 and PHL088B among many others. Bein +g the current monitor a Philips I guess it must be one of them. # I grabbed the relevant part of output of the command: # REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\ +PHL088B\4&2afe7bec&0&UID50529024\Device Parameters" my $registry =<<EOT; 00FFFFFFFFFFFF00410CE5C0FE050000051A010380301B782AE7E5A5564DA1250F5054 +BD4B00D1C09500950FB30081 C0818001010101023A801871382D40582C4500DD0C1100001E000000FF005A51303136 +3035303031353334000000FC0050484C2032323745360A2020 20000000FD00384C1E5311000A202020202020013D EOT my $raw_edid = join'',split /\n/, $registry; my $edid = parse_edid( $raw_edid ); print Dumper $edid;

The output is very verbose and glancing it I dont find any physical measure resembling those of my monitor: I read in the wikipedia article you linked, measures in centimeters are stored in bytes 21-22, but under which names in the following output? Again: my monitor is 48cm x 27cm

$VAR1 = { 'video_input_definition' => { 'separate_sync' => 0, 'sync_on_green' => 1, 'digital' => 0, 'voltage_level' => 0, 'composite_sync' => 1 }, 'EISA_ID' => 'QRF4646', 'max_size_vertical' => 48, 'extension_flag' => 48, 'max_size_horizontal' => 66, 'ratio_name' => '4/3', 'edid_version' => 48, 'checksum' => 50, 'gamma' => 56, 'ratio' => '1.375', 'year' => 2039, 'feature_support' => { 'DPMS_standby' => 0, 'has_preferred_timing' => 0, 'DPMS_suspend' => 0, 'DPMS_active_off' => 1, 'sRGB_compliance' => 1, 'GTF_compliance' => 1, 'rgb' => 1 }, 'max_size_precision' => 'cm', 'diagonal_size' => '32.1294578946507', 'established_timings' => [ { 'vfreq' => 60, 'X' => 640, 'Y' => '480' }, { 'vfreq' => 67, 'X' => 640, 'Y' => '480' }, { 'Y' => '480', 'X' => 640, 'vfreq' => 75 }, { 'X' => 832, 'Y' => '624', 'vfreq' => '75' }, { 'X' => 1024, 'Y' => '768', 'interlace' => 1, 'vfreq' => '87' } ], 'serial_number' => 808470086, 'week' => 52, 'product_code' => 17990, 'detailed_timings' => [ { 'horizontal_active' => 821, 'vertical_dpi' => '44.185416666666 +7', 'vertical_image_size' => 1328, 'stereo' => 2, 'interlaced' => 0, 'horizontal_dpi' => '31.5960606060 +606', 'vertical_sync_pulse_width' => 32, 'vertical_sync_offset' => 19, 'pixel_clock' => '131.21', 'vertical_sync_positive' => 1, 'vertical_blanking' => 2361, 'bad_ratio' => 1, 'ModeLine' => '"821x835" 131.21 82 +1 1127 1181 1897 835 854 886 3196 +hsync +vsync', 'horizontal_sync_pulse_width' => 5 +4, 'horizontal_blanking' => 1076, 'vertical_active' => 835, 'ModeLine_comment' => '# Monitor s +upported modeline (21.6 Hz vsync, 69.2 kHz hsync, ratio 0.98, 31x44 d +pi)', 'digital_composite' => 0, 'vertical_border' => 66, 'horizontal_image_size' => 821, 'horizontal_sync_positive' => 1, 'horizontal_border' => 52, 'horizontal_sync_offset' => 306 }, { 'vertical_blanking' => 48, 'vertical_sync_positive' => 0, 'vertical_active' => 819, 'horizontal_blanking' => 560, 'horizontal_sync_pulse_width' => 8 +17, 'ModeLine' => '"1080x819" 179.89 1 +080 1136 1953 1640 819 822 830 867 +hsync -vsync', 'vertical_border' => 57, 'digital_composite' => 2, 'ModeLine_comment' => '# Monitor s +upported modeline (126.5 Hz vsync, 109.7 kHz hsync, ratio 1.32, 41 dp +i)', 'horizontal_sync_offset' => 56, 'horizontal_sync_positive' => 1, 'horizontal_border' => 70, 'horizontal_image_size' => 824, 'stereo' => 1, 'vertical_image_size' => 2097, 'vertical_dpi' => '43.33875', 'horizontal_active' => 1080, 'horizontal_dpi' => '41.5636363636 +364', 'interlaced' => 0, 'vertical_sync_offset' => 3, 'vertical_sync_pulse_width' => 8, 'pixel_clock' => '179.89' }, { 'pixel_clock' => '123.36', 'vertical_sync_offset' => 3, 'vertical_sync_pulse_width' => 0, 'horizontal_dpi' => '2.19363636363 +636', 'interlaced' => 0, 'vertical_image_size' => 304, 'stereo' => 1, 'vertical_dpi' => '56.726666666666 +7', 'horizontal_active' => 57, 'horizontal_sync_offset' => 57, 'horizontal_sync_positive' => 0, 'horizontal_border' => 48, 'horizontal_image_size' => 817, 'vertical_border' => 49, 'digital_composite' => 2, 'ModeLine_comment' => '# Monitor s +upported modeline (33.0 Hz vsync, 46.2 kHz hsync, ratio 0.05, 2x56 dp +i)', 'horizontal_blanking' => 2613, 'vertical_active' => 1072, 'horizontal_sync_pulse_width' => 8 +20, 'ModeLine' => '"57x1072" 123.36 57 + 114 934 2670 1072 1075 1075 1398 -hsync -vsync', 'bad_ratio' => 1, 'vertical_blanking' => 326, 'vertical_sync_positive' => 0 }, { 'interlaced' => 0, 'horizontal_dpi' => '41.9869696969 +697', 'horizontal_active' => 1091, 'vertical_dpi' => '57.202916666666 +7', 'vertical_image_size' => 1329, 'stereo' => 1, 'pixel_clock' => '141.29', 'vertical_sync_pulse_width' => 16, 'vertical_sync_offset' => 3, 'ModeLine' => '"1091x1081" 141.29 +1091 1139 1961 2421 1081 1084 1100 1385 -hsync +vsync', 'horizontal_sync_pulse_width' => 8 +22, 'horizontal_blanking' => 1330, 'vertical_active' => 1081, 'vertical_sync_positive' => 1, 'vertical_blanking' => 304, 'bad_ratio' => 1, 'horizontal_image_size' => 1089, 'horizontal_border' => 52, 'horizontal_sync_positive' => 0, 'horizontal_sync_offset' => 48, 'ModeLine_comment' => '# Monitor s +upported modeline (42.1 Hz vsync, 58.4 kHz hsync, ratio 1.01, 41x57 d +pi)', 'digital_composite' => 2, 'vertical_border' => 48 } ], 'standard_timings' => [ { 'vfreq' => 111, 'X' => 632, 'Y' => '395', 'ratio' => '16/10' }, { 'ratio' => '16/10', 'Y' => '435', 'X' => 696, 'vfreq' => 108 }, { 'vfreq' => 66, 'ratio' => '4/3', 'Y' => '486', 'X' => 648 }, { 'X' => 640, 'Y' => '480', 'ratio' => '4/3', 'vfreq' => 64 }, { 'Y' => '430', 'ratio' => '16/10', 'X' => 688, 'vfreq' => 116 }, { 'vfreq' => 65, 'Y' => '600', 'ratio' => '4/3', 'X' => 800 }, { 'X' => 800, 'ratio' => '4/3', 'Y' => '600', 'vfreq' => 65 }, { 'vfreq' => 113, 'X' => 704, 'ratio' => '16/10', 'Y' => '440' } ], 'ratio_precision' => 'cm', 'monitor_details' => '', 'edid_revision' => 67, 'manufacturer_name' => 'QRF' };

If I understand you correctly I must figure which is the real current dpi value, modify the scaling accordingly and re-calculate the size in mm. Right?

While this matter is interesting and thanking you for hints and time you spent on it, I'm considering to remove entirely the mm calculation from my application, leaving pixel as only option.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re^2: Tk screen and monitor size in mm, DPI and scaling -- Parse::EDID by Discipulus
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-03-28 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found