From: Micheal Novak <mjn@ksu.ksu.edu>
Subject: Tips & Tricks (Resolution Imperfections)
Date: Sat, 15 Jul 95 02:50:43 -0600

>From: bking@primenet.com (Brien King)
>Subject: Applications Running in Different Resolutions
>Date: Sun, 02 Jul 1995 20:20:11 GMT
>
>I belive I have found the answer to a lot of peoples questions (mine
>included) about Applications that run in different resolutions.
>
>The problem is if you develop an Application in one resolution, say
>1024x768 using Large fonts, then try and run it at say 800x600 using
>Small fonts.  Labels get chopped and components are different sizes
>than when designed.  Other weird looking things happen too.
>
>Well, I found that by changing the PITCH property on the FONT to
>VARIABLE instead of DEFAULT that it looks the same in every
>resolution.
>
>This should be done to every component and to the Form itself.
>
>Does anyone know where "Default" is set?
>
>Brien King
>bking@primenet.com


I think I've found a little bit more of a definitive answer..

After much experimenting, it appears that delphi figures some font 
size and scaling factors at design time, and doesn't re-calculate them 
at run time.  This seems to cause some of the "special effects" at 
different resolutions (i.e. edit boxes with only half of the text 
visible, and labels partly chopped off).

To get around this, make delphi re-calculate these values, by simply 
assigning the main form's font at run time (in the oncreate event),
as well as any other controls in which you didn't use the ParentFont 
option.

I think calling the Font's OnChange event will correct the problem as 
well, but I haven't tried it yet.

I sincerely wish we could get a difinitive answer from borland, or 
someone very knowledgeable on this topic.

On a side note, if I tried to re-assign PixelsPerInch, or the scaled
properties at run time, I got a general protection fault (even the 
example code in the help file gave a GPF).


-Michael Novak
-mjn@ksu.ksu.edu


