{"id":941,"date":"2013-05-06T13:42:01","date_gmt":"2013-05-06T13:42:01","guid":{"rendered":"http:\/\/www.knightware.net\/?p=441"},"modified":"2013-05-06T13:42:01","modified_gmt":"2013-05-06T13:42:01","slug":"vista-advanced-broken-and-fixed-when-running-high-dpi-displays","status":"publish","type":"post","link":"https:\/\/www.knightware.net\/?p=941","title":{"rendered":"Vista Advanced broken (and fixed) when running high DPI displays"},"content":{"rendered":"<p>I recently became the proud owner of a Microsoft Surface PRO device, and was shocked to see that our main software application Vista Advanced looked absolutely horrible!\u00a0 It felt like half\u00a0of the UI was tiny, and the other half was massive in size.\u00a0 The Splash screen\u00a0graphic was even\u00a0bad, having been drawn in a tiled display.\u00a0 Take a look\u00a0at this first-run \/ out-of-box experience on the surface running the latest release (4.0.1 at the time of this writing):<\/p>\n<div id=\"attachment_511\" style=\"width: 352px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.knightware.net\/wp-content\/uploads\/2013\/05\/Screenshot-21.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-511\" class=\" wp-image-511 \" alt=\"Splash screen background image wrapping\" src=\"http:\/\/www.knightware.net\/wp-content\/uploads\/2013\/05\/Screenshot-21.jpg\" width=\"342\" height=\"116\" \/><\/a><p id=\"caption-attachment-511\" class=\"wp-caption-text\">Splash screen background image wrapping<\/p><\/div>\n<div id=\"attachment_531\" style=\"width: 635px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.knightware.net\/wp-content\/uploads\/2013\/05\/Screenshot-3.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-531\" class=\" wp-image-531 \" alt=\"Oversized controls and UI elements make the app usability pretty rough\" src=\"https:\/\/knightware.azurewebsites.net\/wp-content\/uploads\/2013\/05\/Screenshot-3-1024x576.jpg\" width=\"625\" height=\"351\" \/><\/a><p id=\"caption-attachment-531\" class=\"wp-caption-text\">Oversized controls and UI elements make the app usability pretty rough<\/p><\/div>\n<h1>The Problem<\/h1>\n<p>The problem, it turns out, has to do with the application&#8217;s UI frameworks detecting the selected resize mode for the OS (set to 150% scale by default on high DPI devices like the Surface PRO), and scales up the bitmaps and fonts accordingly.\u00a0 The really annoying part is that only some of the UI elements are affected by this, and this is due to a combination of different technologies and control libraries being used together to put Advanced together.<\/p>\n<h1>The Workaround (read: Hack)<\/h1>\n<p>There is a work-around to allow existing versions of Vista Advanced software to look normal on your high DPI device, and the way to do this is to open display resolution in control panel and look for the link that says &#8216;Make text and other items larger or smaller&#8217;.\u00a0 That link will bring you to the dialog below, and from this dialog set the size of\u00a0all items to 100% (Smaller).\u00a0 This affects the entire OS, and has the additional requirement of needing\u00a0you to log out and back in before the setting will take effect.\u00a0 \u00a0This is certainly far from ideal, but in a pinch it&#8217;ll at least get you by.<\/p>\n<div id=\"attachment_571\" style=\"width: 635px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/knightware.azurewebsites.net\/wp-content\/uploads\/2013\/05\/Screenshot.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-571\" class=\"size-large wp-image-571\" alt=\"Use display settings to change the default size of items to 100%\" src=\"https:\/\/knightware.azurewebsites.net\/wp-content\/uploads\/2013\/05\/Screenshot-1024x592.jpg\" width=\"625\" height=\"361\" \/><\/a><p id=\"caption-attachment-571\" class=\"wp-caption-text\">Use display settings to change the default size of items to 100%<\/p><\/div>\n<h1>The Real Fix<\/h1>\n<div id=\"attachment_491\" style=\"width: 367px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.knightware.net\/wp-content\/uploads\/2013\/05\/Screenshot-6.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-491\" class=\" wp-image-491  \" alt=\"Modification to AssemblyInfo.cs to disable DPI awareness\" src=\"http:\/\/www.knightware.net\/wp-content\/uploads\/2013\/05\/Screenshot-6.jpg\" width=\"357\" height=\"51\" \/><\/a><p id=\"caption-attachment-491\" class=\"wp-caption-text\">Modification to AssemblyInfo.cs to disable DPI awareness<\/p><\/div>\n<p>Luckily there is a simple software fix for this problem that we were able to put in place.\u00a0Inserting the <a title=\"DisableDpiAwareness\" href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.windows.media.disabledpiawarenessattribute.aspx\" target=\"_blank\" rel=\"noopener\">DisableDpiAwareness <\/a>attribute at the\u00a0main application&#8217;s assembly level will disable the DPI scaling that happens on these high DPI devices, causing\u00a0our application to render the same size on all computers.\u00a0 Setting this attribute immediately brings the application back into it&#8217;s normal look and feel:<\/p>\n<div id=\"attachment_501\" style=\"width: 316px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/knightware.azurewebsites.net\/wp-content\/uploads\/2013\/05\/Screenshot-41.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-501\" class=\" wp-image-501 \" alt=\"Normal looking splash screen after setting DisableDpiAwareness\" src=\"https:\/\/knightware.azurewebsites.net\/wp-content\/uploads\/2013\/05\/Screenshot-41.jpg\" width=\"306\" height=\"113\" \/><\/a><p id=\"caption-attachment-501\" class=\"wp-caption-text\">Normal looking splash screen after setting DisableDpiAwareness<\/p><\/div>\n<div id=\"attachment_521\" style=\"width: 635px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.knightware.net\/wp-content\/uploads\/2013\/05\/Screenshot-51.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-521\" class=\"size-large wp-image-521\" alt=\"Normal Advanced application look after setting DisableDpiAwareness attribute\" src=\"https:\/\/knightware.azurewebsites.net\/wp-content\/uploads\/2013\/05\/Screenshot-51-1024x576.jpg\" width=\"625\" height=\"351\" \/><\/a><p id=\"caption-attachment-521\" class=\"wp-caption-text\">Normal Advanced application look after setting DisableDpiAwareness attribute<\/p><\/div>\n<p>Now with this fix, you can see Advanced looks as one might expect it to look again, and without the user having to make any screen resolution hacks to do it.\u00a0 You&#8217;ll see this fix in the next beta version of software (0.55.8), which will roll into version 4.0.2 for those of you who wait for release builds only.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently became the proud owner of a Microsoft Surface PRO device, and was shocked to see that our main software application Vista Advanced looked absolutely horrible!\u00a0 It felt like half\u00a0of the UI was tiny, and the other half was massive in size.\u00a0 The Splash screen\u00a0graphic was even\u00a0bad, having been drawn in a tiled display.\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,10],"tags":[],"class_list":["post-941","post","type-post","status-publish","format-standard","hentry","category-software","category-vista-systems"],"_links":{"self":[{"href":"https:\/\/www.knightware.net\/index.php?rest_route=\/wp\/v2\/posts\/941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knightware.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knightware.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knightware.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knightware.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=941"}],"version-history":[{"count":0,"href":"https:\/\/www.knightware.net\/index.php?rest_route=\/wp\/v2\/posts\/941\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.knightware.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knightware.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knightware.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}