简体   繁体   中英

Scaling DbGrid Indicator and DbNavigator Icons on 4K display

I am using DPro Rio 10.3 on an HP Spectre x360, which has a 4K display. The indicator on DbGrids and icons for DbNavigator controls scale fine at 1980 X 1080, but are almost invisible at 4K resolution. Text scales fine at any resolution.

I looked at the source code for both components and they contain methods which use LoadfromResource to load the appropriate graphic from the executable. TDbNavigator calls LoadfromResourse in a virtual method, SetButtonGlyph at runtime.

In addition, the DbGrid code seems to make an effort to scale the indicator in one of its methods. This, however, does not work, at least on my laptop.

FYI, I have set the form's Scaled property to TRUE. I have also tried several settings in the manifest, but none make a difference.

How can I fix this problem. Is it because these controls use a 16 x 16 graphic or is there some other cause? Is there a way to replace the graphics for each component with ones of higher resolution either in the executable resource file or programatically at runtime?

I stumbled across the answer from a post on the TMS Software website. In order to display properly on 4k screens, DPI awareness must be set to none. I tested this both in Rio and Tokyo, and it works. For Rio, you would select Project|Options and go to the Application section. Select Manifest and from the dropdown box for DPI Awareness, select None.

For Tokyo, also Project|Options, go to Application and uncheck Enable DPI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM