A Delphi Developers Guide to 4K

This section is for programmers. Please use it for all discussons on interfacing help with your applications and related subjects.

Moderators: Alexander Halser, Michael Schwarzl

Post Reply
User avatar
Alexander Halser
EC-Software Support
Posts: 4097
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

A Delphi Developers Guide to 4K

Unread post by Alexander Halser »

We spent a serious amount of time over the last couple of months to do an inventory and the necessary steps to make Help & Manual ready for ultra-high resolution ("4K") monitors. Some of the changes will be implemented in the upcoming 6.5.2 release this November, some other features had to be postponed for a later update, because they are still not working as expected.

It was an interesting journey to explore the detailed requirements of 4K and I have put my humble knowledge about this topic into a Delphi programming tutorial, which I put up here for download.

Download link:
http://download.ec-software.com/delphi- ... ide-4k.zip (~ 10mb)

The tutorial is about 40 pages long and covers the basic topics (explanation of scaling and DPI values) to the more sophisticated implementation of runtime DPI-switching on Windows 8.1 with multiple monitors. A DPI-aware test application (compiled and with source) is included. The test application is fully per-monitor DPI-aware on Windows 8.1.
delphi-4k-guide-contents.png
You do not have the required permissions to view the files attached to this post.
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: A Delphi Developers Guide to 4K

Unread post by Martin Wynne »

Many thanks for that, Alexander. :)

I wish I had that a month ago, because I have just gone through the process of making my application dpi-aware. It's been a bit of a minefield. :(

Generally the dialogs are ok and the virtualization results would have been acceptable. Where virtualization is not acceptable is where you are doing direct CAD-style drawing on the form's Canvas. The result is that crisp 1-pixel lines become smudged and the whole thing looks awful, completely destroying the advantage of having a high-resolution display. Unfortunately there doesn't seem to be any way of separating the two -- I would have been happy to leave virtualization for the controls if I could be sure of pixel-perfect line drawing on the Canvas.

In the event I have had to do the whole thing. Which has meant going through several dozen forms, making minor tweaks to font sizes and label dimensions on hundreds of controls, and testing everything at 4 different scaling settings. Fortunately I developed the whole thing at 120dpi in the first place, so the adjustments have not been as drastic as they might have been.

But finally it is looking good on my Surface Pro 3 (the arrival of which prompted all this). I have drawn the line at doing multi-monitor scaling because life is too short to do everything.

Thanks again,

Martin.
User avatar
Kevin_MBS
Posts: 2
Joined: Tue Nov 23, 2010 10:30 pm
Location: Fargo, North Dakota
Contact:

Re: A Delphi Developers Guide to 4K

Unread post by Kevin_MBS »

I was wondering where I can find this document as my AV is blocking the download of the file.
This request is blocked by the SonicWALL Gateway Anti-Virus Service. Name: Banload.A_26 (Trojan)
User avatar
Alexander Halser
EC-Software Support
Posts: 4097
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: A Delphi Developers Guide to 4K

Unread post by Alexander Halser »

This is a false positive, the file is clean. When you donwload it, it must be exactly 9.991.863 bytes in size.
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply