![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
Q: Determine if a system is using the large or small font setting.Answer: The easiest way to do this is to read the PixelsPerInch property of the global Screen object. If the value is 96, then the system is set to small fonts. If PixelsPerInch is 120, then the large font setting is in effect. It is possible for PixelsPerInch to be neither 96 or 120 because the user can set the font scaling factor directly. __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { if(Screen->PixelsPerInch == 96) Label1->Caption = "Small fonts in use"; else if(Screen->PixelsPerInch == 120) Label1->Caption = "Large fonts in use"; else { float Ratio = ((float)Screen->PixelsPerInch) / 96.0; Ratio *= 100.0; Label1->Caption = "Fonts are set to " + IntToStr((int)Ratio) + " %"; } } | ||||||
All rights reserved. |