[DUG] Procedure run from main program
John Bird
johnkbird at paradise.net.nz
Wed Oct 12 14:57:24 NZDT 2016
Agreed about previous comments and this one too – I had standalone code that does this and you get into weird distortions if you scale same form more than once, so refer always to original sizes.
Also you may need to do extra for grids – grid font size has to be checked against default row height and column widths generally also need to be resized, as some are scaled and some not just to make life fun.
I have code to do this if of use for Stringgrids.
Also usually images do not scale.
And then there is the issue of catering for different screen DPI just to be fun, form scaling will behave differently if not 96DPI
From: Jolyon Direnko-Smith
Sent: Wednesday, October 12, 2016 12:59 PM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Procedure run from main program
To all of the implementation tips/observations aside, I would add the following:
Any scaling based on simply modifying current values and using floating point and rounding is going to suffer from asymmetry and creeping rounding issues if forms are frequently scaled and rescaled.
Asymmetry I mean that - for example - applying a scale of 3.0x to a form will not necessarily be exactly undone by then applying a scale of (1 / 3) x (0.333333333333x). Recurring decimals are the most obvious case where problems are likely to occur, but the nature of floating point representation means that they are not the only ones.
This may not be a concern in your case, but then again it might be. :)
A more robust approach would be to establish reference dimensions for each form (the "1 x" dimensions) and to always scale with respect to those reference dimensions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20161012/87229684/attachment-0001.html
More information about the Delphi
mailing list