Forum > Designer

DesignTimePPI : is it possible to prevent automatic change ?

(1/2) > >>

BrunoK:
When working on forms defined with DesignTimePPI of 96 on a system with PPI of 216, the form designer recalculates and switches dimensions to match PPI 216.

But, these form being designed by the Lazarus team, DesignTimePPI should not be allowed to change.

How, where, can one force the designer to retain the original DesignTimePPI  of 96 ?

Blaazen:
There is a hint on this page: https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above

--- Quote ---Hint: Do not develop under HighDPI Mode, always develop under normal mode and only test under HighDPI. Otherwise Lazarus IDE will set DesignTimePPI of the different forms to different values.
--- End quote ---

But I don't understand what that means. Because if you develop form under hi-DPI and someone will open it under low DPI it will scale down again. Even more, there'll be surely only hi-DPI desktops in a near future.

Try to ask on Lazarus mailing list, there is Ondřej Pokorný who developed hi-DPI support for Lazarus, he probably does not visit this forum.

BrunoK:

--- Quote from: Blaazen on June 24, 2023, 12:44:35 am ---There is a hint on this page: https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above

--- Quote ---Hint: Do not develop under HighDPI Mode, always develop under normal mode and only test under HighDPI. Otherwise Lazarus IDE will set DesignTimePPI of the different forms to different values.
--- End quote ---
.
--- End quote ---
Easier said than done. I understand the interest of working at 96 PPI (that being that the minimal width of a line would be 1 in 96PPi up scale's acceptably well but down-scaling is going to create 0 width lines if defined as 2 pixel on my 212 PPI screen), but I tell you it si impossible on a 13.3" high resolution screen. A character being displayed with a height of maybe 1 mm, even with a very good sight, that's impossible.

I have looked on Lazarus mailing list and there has been a informative discussion, and a test of PPI conversion that sadly does not compile. I cant figure out how the participants could chat about it without a non compilable program.
 
Having read that and my recent experience of some patches to lazarus convince me that I'll have to do more testing. It has been hell to reverse my repository to keep 96 PPI dimensions while testing and preparing patches.


JuhaManninen:

--- Quote from: BrunoK on June 24, 2023, 01:27:27 pm ---I understand the interest of working at 96 PPI (that being that the minimal width of a line would be 1 in 96PPi up scale's acceptably well but down-scaling is going to create 0 width lines if defined as 2 pixel on my 212 PPI screen), but I tell you it si impossible on a 13.3" high resolution screen. A character being displayed with a height of maybe 1 mm, even with a very good sight, that's impossible.

--- End quote ---
Heh, I have now an oldish recycled 40" Sony Bravia TV as my monitor. I have to sit a little too close when typing. When I watch videos I sit further away and it is perfect.
Resolution is 1920 * 1080. No need for High-DPI.
I don't have a television in the traditional sense. No antenna, no cable. Everything I watch comes through internet. Some years ago I got fed up with the junk coming from TV.
This 40" screen is a big contrast to my passively cooled mini-PC. A small computer, a big screen.

wp:

--- Quote from: BrunoK on June 24, 2023, 01:27:27 pm ---
--- Quote from: Blaazen on June 24, 2023, 12:44:35 am ---There is a hint on this page: https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above

--- Quote ---Hint: Do not develop under HighDPI Mode, always develop under normal mode and only test under HighDPI. Otherwise Lazarus IDE will set DesignTimePPI of the different forms to different values.
--- End quote ---
.
--- End quote ---
Easier said than done. I understand the interest of working at 96 PPI (that being that the minimal width of a line would be 1 in 96PPi up scale's acceptably well but down-scaling is going to create 0 width lines if defined as 2 pixel on my 212 PPI screen), but I tell you it si impossible on a 13.3" high resolution screen. A character being displayed with a height of maybe 1 mm, even with a very good sight, that's impossible.

I have looked on Lazarus mailing list and there has been a informative discussion, and a test of PPI conversion that sadly does not compile. I cant figure out how the participants could chat about it without a non compilable program.
 
Having read that and my recent experience of some patches to lazarus convince me that I'll have to do more testing. It has been hell to reverse my repository to keep 96 PPI dimensions while testing and preparing patches.

--- End quote ---
Here is a little experiment: I am normally developing on Win-11 at 96ppi and wrote a simple project this way - nothing special, just a few controls, but I checked LCLScaling and selected the "on (True)" DPI scaling setting. This is the default setting, and it is enough to create a scaling application. The form has Scaled=true, and a Width=320 and Height=240 pixels. The attached image "1-..." is taken at runtime (at designtime, it looks the same, of course).

On my Windows system I have a second user which is setup to run at 144 ppi (150%). I switched to this user and ran the application compiled before at 96ppi. Image "2-..." is taken now at 144ppi - everything looks the same, just magnified by the factor 1.5. I started Lazarus which runs at 144 ppi now, and loaded the project - the form looks the same. I added an additional button; it has the size like the other buttons (--> Image "3-...") and compiled.

Returning to my standard user at 96 ppi, I ran the application again which was compiled at 144ppi - the screenshot looks like the first one, just the additonal button (image "4-..."). Loaded the project into the IDE - again no problems.

So, I wonder why people give false statements such as "Do not develop under High-DPI mode"... It is my impression that LCLScaling is rather simple for the application developer: just make the settings mentioned - that's it. Do not attempt to scale anything by yourself.

Scaling is more difficult for the component developer because he has to take care of scaling of the internal dimensions of the component and of the scaling of fonts (except for the standard "Font" property). There has been a recent discussion in the mailing list where Ondrej explained some details (https://lists.lazarus-ide.org/pipermail/lazarus/2023-June/240437.html).

Navigation

[0] Message Index

[#] Next page

Go to full version