{"id":731,"date":"2020-02-12T03:17:01","date_gmt":"2020-02-12T02:17:01","guid":{"rendered":"https:\/\/www.kassebaum.eu\/?p=731"},"modified":"2020-02-12T22:18:11","modified_gmt":"2020-02-12T21:18:11","slug":"context-for-high-dpi-with-new-icons","status":"publish","type":"post","link":"https:\/\/www.kassebaum.eu\/blog\/2020\/02\/12\/context-for-high-dpi-with-new-icons\/","title":{"rendered":"ConTEXT for High DPI with new Icons"},"content":{"rendered":"<p>Today I published a new version of the ConTEXT editor.<\/p>\n<p>As I explained in my previous posts ConTEXT is a small, fast and powerful freeware text editor, developed to serve as a secondary tool for software developers.<\/p>\n<p>It has originally been hosted <a href=\"http:\/\/www.contexteditor.org\/index.php\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. Since I couldn&#8217;t contact the original developers I published the source code under <a href=\"https:\/\/bitbucket.org\/ConTextEditor\/context\" target=\"_blank\" rel=\"noopener noreferrer\">bitbucket<\/a>. The code can be compiled with Delphi 10.3.3 Rio. I also added the <a href=\"https:\/\/bitbucket.org\/ConTextEditor\/context\/downloads\/ConTEXT.exe.32\" target=\"_blank\" rel=\"noopener noreferrer\">Win32<\/a> and <a href=\"https:\/\/bitbucket.org\/ConTextEditor\/context\/downloads\/ConTEXT.exe.64\" target=\"_blank\" rel=\"noopener noreferrer\">Win64<\/a> binaries. For the German language I uploaded a <a href=\"https:\/\/bitbucket.org\/ConTextEditor\/context\/downloads\/Deutsch.lng\" target=\"_blank\" rel=\"noopener noreferrer\">language file<\/a>.<\/p>\n<p>The first huge change that I added to ConTEXT are new icons. The old ones looked some kind of ancient and didn&#8217;t exist in higher resolutions. That&#8217;s why one of the Embarcadero Product Managers, David Millington, sponsored new icons. They really look fantastic and many thanks to David for this great support!\u00a0 He also told me that he will publish theses icons under an open source license, so that the Delphi community can use them. As soon as David will publish them I will tell you.<\/p>\n<p>Since the new icons are available in different resolutions I used the new TVirtualImageList of Delphi Rio. The <a href=\"http:\/\/docwiki.embarcadero.com\/RADStudio\/Rio\/en\/Supporting_high-DPI_images_with_the_Image_Collection_and_Virtual_ImageList_components\" target=\"_blank\" rel=\"noopener noreferrer\">Embarcadero Wiki<\/a> explains all details about this component. In short words it finds out during runtime which resolution of an icon fits best to the current resolution of the screen. This means that in this case the icons are not stretched under High DPI, the virtual image list simply uses the icons with the higher resolution.<\/p>\n<p>I also set the &#8220;scaled&#8221; property of all forms during designtime to true. In a nutshell scaled forms automatically resize themselves to the DPI of the screen. This feature has been improved in Delphi Rio so that I can only recommend to use Delphi Rio for High DPI.<\/p>\n<p>ConTEXT use some very old components that use hard coded positions with Left, Top, Width and Height. For this code you always have to consider that the Delphi designer internally saves all positions for 96 DPI. This means that you have to recalculate these positions with MulDiv like<\/p>\n<pre class=\"lang:delphi decode:true\" title=\"MulDiv\">Height := MulDiv(Height, Screen.PixelsPerInch, 96);\r\n<\/pre>\n<p>If you are interested then use ConTEXT and enjoy the fact that the legacy code has been compiled with Delphi Rio and supports modern features like High DPI! And also look at David&#8217;s new icons!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I published a new version of the ConTEXT editor. As I explained in my previous posts ConTEXT is a small, fast and powerful freeware text editor, developed to serve as a secondary tool for software developers. It has originally &hellip; <a href=\"https:\/\/www.kassebaum.eu\/blog\/2020\/02\/12\/context-for-high-dpi-with-new-icons\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,34,35,38,13,21,27,3,1],"tags":[],"class_list":["post-731","post","type-post","status-publish","format-standard","hentry","category-rad-studio-10-seattle","category-rad-studio-10-1-berlin","category-rad-studio-10-2-tokyo","category-rad-studio-10-3-rio","category-rad-studio-xe5","category-rad-studio-xe6","category-rad-studio-xe8","category-tipsandtricks","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/posts\/731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/comments?post=731"}],"version-history":[{"count":10,"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/posts\/731\/revisions"}],"predecessor-version":[{"id":741,"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/posts\/731\/revisions\/741"}],"wp:attachment":[{"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/media?parent=731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/categories?post=731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kassebaum.eu\/blog\/wp-json\/wp\/v2\/tags?post=731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}