DelphiFeeds.com

  • Dashboard
  • Popular Stories
  • Trending Stories
  • Feeds
  • Login
Trending now

Powerful Multi-sensor Imaging Tool For Processing And Analyzing Hyperspectral Images Built In Delphi

How to write Delphi apps to run and look great on Windows, macOS and Linux

VCL Grid goodies

Learn A Powerful Python Concept: Modules And Packages With A Delphi Windows GUI App

The IFDEF Problem!

Quickly Build Natural Language Processing Capable GUI Apps With Delphi And Python NLTK

Freebie Friday: capture controls or forms

Easily Learn How To Use Python List Comprehensions In A Delphi Windows GUI App

Quickly Migrate and Modernize Your Delphi/C++ Apps Using FastReport With Windows High DPI Setup

1
Anbarasan Anbarasan 2 months ago in C++, cbuilder, Delphi, DPI Awareness Mode, FastReport, HiDPI, object pascal, Per-MonitorV2, programming, RAD Studio, windows 0

Display panel manufacturers have packed an increasing number of pixels into each unit of physical space on their panels resulted in the dots per inch (DPI) of modern display panels. In the past, most displays had 96 pixels per linear inch of physical space (96 DPI); in 2017, displays with nearly 300 DPI or higher are readily available. Variety of monitors like SD, Full HD, 4K Ultra HD, 8K Ultra HD in the market.

We have laptops, desktops with small screens, and without display scale factor/DPI changes it’s very hard to use it and this can be even more complicated when talking about Full HD, 4K Ultra HD, 8K Ultra HD. Our application should be able to handle them. You cannot be sure what every user prefers.

Some common scenarios where the display scale factor/DPI changes are:

  • Multiple-monitor setups where each display has a different scale factor and the application is moved from one display to another (such as a 4K and a 1080p display)
  • Docking and undocking a high DPI laptop with a low-DPI external display (or vice versa)
  • Connecting via Remote Desktop from a high DPI laptop/tablet to a low-DPI device (or vice versa)
  • Making display-scale-factor settings change while applications are running

Desktop applications must tell Windows if they support DPI scaling. By default, the system considers desktop applications DPI unaware and bitmap-stretches their windows. By setting one of the Unaware, System, Per-Monitor, and Per-MonitorV2. available DPI awareness modes, applications can explicitly tell Windows how they wish to handle DPI scaling.

When updating a System DPI-aware application to become Per-MonitorV2 aware, the code which handles UI layout needs to be updated such that it is performed not only during application initialization but also whenever a DPI change notification (WM_DPICHANGED in the case of Win32) is received.

Things to know on migrating your Delphi Application to High DPI ?

  • Set the DPI awareness Mode in Project->Options->Application->Manifest-DPI Awareness and Select Per-MonitorV2.
  • Use Sceen.PixelsPerInch-primaryDispaly DPI
  • Use TVirtualImageList instead of TImageList.
  • Check all custom draw for absolute positions
  • Use Control.CurrentPPI to get Current PPI of Control
  • Mixed Mode for dialogs(SetThreadDPIAwarenesscontext)
  • Use Form events OnBeforeMonitorDPIChanged/OnAfterMonitorDPIChanged.

Note: Ensure backward compatibility for your platform and Delphi version of your application.

Some of the Delphi And FastReport High DPI Controls:

  • TControl: procedure such as ScaleforPPI, ChangScale, ScaleControlsForPPI helps for High DPI change.
  • TFrxBAseForm: procedure such as UpdateResources, UpdateFormPPI, ProcessPreferences, and Message WM_DPICHANGED helps for FastReport form DPI change.
  • TFrxDPIAwareCustomControl: procedure such as DoPPIChanged, GetScale, and Message WM_DPICHANGED_AFTERPARENT helps for FastReport custom control DPI change.

Check out the Video Fast Migration to Windows 10 High DPI, below for Demonstration.

Check the latest RAD Studio 10.4.1 Features which includes VCL Style Changes for High DPI.

Trending Stories

  • Powerful Multi-sensor Imaging Tool For Processing And Analyzing Hyperspectral Images...

  • How to write Delphi apps to run and look great...

  • VCL Grid goodies

  • Learn A Powerful Python Concept: Modules And Packages With A...

  • The IFDEF Problem!

Embarcadero GetIt

  • Brook Framework

    Microframework which helps to develop web Pascal applications.

  • Trial - TMS Scripter

    Add the ultimate flexibility and power into your apps with native Pascal or Basic scripting and […]

  • Trial - TMS VCL Chart

    DB-aware and non DB-aware feature-rich charting components for business, statistical, financial […]

  • Trial - TMS VCL Cloud Pack

    TMS VCL Cloud Pack is a Delphi and C++Builder component library to seamlessly use all major cloud […]

  • Trial - TMS VCL UI Pack

    Create modern-looking & feature-rich Windows applications faster with well over 600 components […]

  • Learn Delphi Programming
  • Learn C++
  • Embarcadero Blogs
  • BeginEnd.net
  • Python GUI
  • Firebird News
  • Torry’s Delphi Pages
Copyright DelphiFeeds.com 2021. All Rights Reserved
Embarcadero
Login Register

Login

Lost Password

Register

Lost Password