1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| { ======================================================================= }
procedure ScaleFen(Fen: TForm; ScreenWidth, ScreenHeight: LongInt) ;
Begin
Fen.Scaled := True ;
Fen.Position := poScreenCenter ;
If (Screen.Width <> ScreenWidth) then
Begin
Fen.Height := LongInt(Fen.Height) * LongInt(Screen.Height) div ScreenHeight ;
Fen.Width := LongInt(Fen.Width) * LongInt(Screen.Width) div ScreenWidth ;
Fen.ScaleBy(Screen.Width,ScreenWidth) ;
End;
End;
{ ======================================================================= }
Procedure TForm1.FormCreate(Sender: TObject);
Begin
Scaled := False ;
If Screen.PixelsPerInch <> PixelsPerInch then ScaleBy(Screen.PixelsPerInch, PixelsPerInch) ;
End;
{ ======================================================================= } |
Partager