{"id":2538,"date":"2010-03-05T11:53:35","date_gmt":"2010-03-05T11:53:35","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2010\/03\/05\/uisetscreenpixelsperinch\/"},"modified":"2017-01-06T21:27:41","modified_gmt":"2017-01-07T02:27:41","slug":"uisetscreenpixelsperinch","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2010\/03\/05\/uisetscreenpixelsperinch\/","title":{"rendered":"UISETSCREENPIXELSPERINCH"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/5021\">Bob<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/25980-uisetscreenpixelsperinch\">UISETSCREENPIXELSPERINCH<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/57794\">Varun Gandhi<\/a>.\r\n      <\/p>\r\n   <\/introduction>\r\n   <p>My display resolution setting is 96 dots per inch (DPI) but how accurate is my screen? Varun's submission made short work\r\n      (fun really) of finding out.\r\n   <\/p>\r\n\r\n   <p>I just laid a ruler on my screen. It didn't quite fit the tick marks. I had to reduce from 96 to 94 dpi. Pretty cool!<\/p>\r\n   <p>Is accuracy of display resolution important to you? Please tell us about it <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2538#respond\">here<\/a>.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_3658538fe88d4a129f1a63d491a7bd1a() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='3658538fe88d4a129f1a63d491a7bd1a ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 3658538fe88d4a129f1a63d491a7bd1a';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Robert Bemis';\r\n        copyright = 'Copyright 2010 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_3658538fe88d4a129f1a63d491a7bd1a()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.11<br><\/p>\r\n<\/div>\r\n<!--\r\n3658538fe88d4a129f1a63d491a7bd1a ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/5021 Bob>'s \r\n% pick this week is \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/25980-uisetscreenpixelsperinch UISETSCREENPIXELSPERINCH> \r\n% by \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/57794 Varun Gandhi>.\r\n%%\r\n% My display resolution setting is 96 dots per inch (DPI) but how accurate\r\n% is my screen? Varun's submission made short work (fun really) of finding\r\n% out.\r\n%%\r\n% <<https:\/\/www.mathworks.com\/matlabcentral\/fx_files\/25980\/1\/screenshot1.png>>\r\n%%\r\n% I just laid a ruler on my screen. It didn't quite fit the tick marks. I\r\n% had to reduce from 96 to 94 dpi. Pretty cool!\r\n%%\r\n% Is accuracy of display resolution important to you? Please tell us about\r\n% it <https:\/\/blogs.mathworks.com\/pick\/?p=2538#respond here>.\r\n\r\n##### SOURCE END ##### 3658538fe88d4a129f1a63d491a7bd1a\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      Bob's pick this week is UISETSCREENPIXELSPERINCH by Varun Gandhi.\r\n      \r\n   \r\n   My display resolution setting is 96 dots per inch (DPI) but how accurate is my screen? Varun's... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2010\/03\/05\/uisetscreenpixelsperinch\/\">read more >><\/a><\/p>","protected":false},"author":46,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2538"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2538"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2538\/revisions"}],"predecessor-version":[{"id":8333,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2538\/revisions\/8333"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}