RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!

Windows 10 and Modern High DPI Display Support in Delphi and C++Builder

Display sizes and resolutions today are often significantly higher resolution than a few years ago. On the machine where I’m writing, I have one 1920×1080 24″ external display (once considered a really good size!) plus the 2880×1800 15″ Retina screen on the MacBook Pro the other screen is plugged into. This means the external monitor, which has 2/3 the vertical pixels on a display 1.25 times vertically larger, has a very different number of pixels per inch – a much lower number of pixels in the same physical area. Specifically, the external display has 90 pixels per inch, whereas the MacBook Pro screen has 227 pixels per inch, almost two and a half times as many – 2.44 times, to be exact. This is known as high DPI, where DPI is ‘dots per inch.’ Terminology gets a bit confused between dots – originally from print – and pixels.

The high resolution craze was led by Apple, first introducing a ‘Retina’ display with the iPhone 4 in 2010, followed by the MacBook Pro line in 2012. But higher resolutions – more pixels in the same physical area – led to a problem, especially for Windows. Traditionally, UI layout was done measured in pixels, not in physical display distance. A small icon such as a toolbar icon was always 16 x 16 pixels, for example; a standard button was 75 pixels wide and 25 pixels high (24 for some non-Delphi UI-built apps.) Yet with the rise in screen resolution, the physical display size of those pixels was greatly shrunk. A toolbar icon on my external display is 0.44 cm, or 0.17″, high; the same icon on my laptop display is 0.17cm or 0.07″ high. While Windows 7 made some attempt to resolve this with high DPI support, it wasn’t until Windows 10 that this was fully and robustly addressed in Windows, with ‘perMonitorv2’ high DPI support introduced in Windows 10 Creator’s Update.

(That it is version 2 of per-monitor high DPI support in Windows, and that this is one of several other high DPI display settings indicates the complexity, number of options, and number of iterations there were solving the issue in Windows.)

In Windows 10, applications supporting the perMonitorv2 high DPI can scale each window dynamically as the resolution changes. That is, I can drag any window of an app between the two displays described above, and as it moves from one to the other it can adjust its own scale (including the non-client area, themed rendering, and more) to retain the same physical size. Apps can have different windows with different scales. Delphi and C++Builder added support for high DPI in the VCL (Windows UI framework) in version 10.3, released in November 2018. Since then the point releases have also included tweaks and updates, and we have many satisfied customers using the VCL’s high DPI support.

In fact, high DPI support for VCL styles (themes) and for the IDE itself are on the roadmap now that the VCL has supported high DPI for some time.


The VCL’s high DPI support is automatic. All you do is turn it on in the Project Options > Manifest page, and your app will behave correctly, adjusting the size and position of any UI control. Since controls render either drawing shapes (eg lines and borders) or through Windows themes (which have high DPI support in Windows 10), the app and its controls will appear exactly the same, just more or less crisp depending on the monitor it’s currently placed on.

…with one exception.

That exception is images, such as icons in a toolbar.

Windows stores images in image lists, which are collections of images all of a single size. You might spot the problem here: the toolbar button may scale to, say, 2.5x its original pixel size, but the image it displays won’t — and it will consequently draw blurrily as it upscales the 16×16 image to (say) 40×40.

tcheckbox16-8507845 A 16×16 pixel icon
tcheckbox_2d00_16-upscaled-to-40-7485561 The same 16×16 icon, scaled upwards to 2.5 times its size (40×40).
This is what you’ll get with many high DPI applications
tcheckbox_2d00_128-_2d00_-actually-96-_2d00_-40px-8100358 A crisp version of the same image. This is what you get using Delphi and C+Builder.

This is where some amazing Delphi and C++Builder technology comes in. When we released high DPI VCL support in RAD Studio 10.3, we didn’t just support Windows’ own high DPI perMonitorv2 support. We went further and addressed the image scaling problem, something Windows’ own image lists have not yet done. We did this by introducing the virtual image list, a high DPI image list that can produce crisp images for any DPI or scaling. It’s fully backwards compatible with traditional TImageList-s, including Windows image lists (it has a HIMAGELIST handle), but handles scaling, and it’s a great example of the value our tools provide. You can’t achieve that without our frameworks without very significant manual effort.

You can read more in our thorough documentation on the VCL high DPI image list components.

Windows 10 and RAD Studio – Modern UIs

The pair of Windows 10 and RAD Studio 10.3 let you create applications with crisp, modern, scaling, DPI-aware user interfaces that look great on any display.

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

David is an Australian developer, currently living in far-north Europe. He is the senior product manager for C++ at Idera, looking after C++Builder and Visual Assist.
Related posts
DelphiNewsRAD Studio

Leveraging High DPI with Ray Konopka - DelphiCon 2020

C++NewsRAD Studio

Open for Business with 10.4! - May 2020 GM Update


New VCL TEdgeBrowser Component in RAD Studio 10.4


Delphi na área de saúde, combatendo à pandemia do coronavírus [ em português ]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.