Thanks, please confirm me if I understand well the concept: 1) when component is put on the form in designer: it is scaled (Width & Height) 2) when it is put on the form later in code: it is not scaled but internals are scaled in both cases (by internals I mean for example DefaultRowHeight and DefaultColWidth of TStringGrid) Or at least TStringGrid behaves as I described above. Because I need to scale internals of TGraphicControl (which has no own Canvas or Handle) I decided to do scaling in SetParent();. For curiosity: was tested the case when someone has two or more monitors with different DPI and moves the form (made in Lazarus) from one monitor to another? V.
______________________________________________________________
Od: "Ondrej Pokorny" <laza...@kluug.net> Komu: "Lazarus mailing list" <lazarus@lists.lazarus-ide.org>, laza...@lists.lazarus.freepascal.org Datum: 07.06.2023 08:19 Předmět: Re: [Lazarus] Hi-DPI tweak of components
On 07.06.2023 00:35, Vojtěch Čihák via lazarus wrote:... Here is information: https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above <https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above> IIRC, DoAutoAdjustLayout() is executed only when the DPI changes. You have to scale every hardcoded pixel value in the constructor/loading/intitialize as well. Ondrej
-- _______________________________________________ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus