Fórum resolução de tela #172745
02/08/2003
0
e aí pessoal
alguem sabe como resolver o problema da resolução de tela?
falô
Ivan
alguem sabe como resolver o problema da resolução de tela?
falô
Ivan
Ivan Andre
Curtir tópico
+ 0
Responder
Posts
02/08/2003
Nildo
Como assim?
Q problema?
Q problema?
Responder
Gostei + 0
02/08/2003
Paulo
Se o problema é preparar o seu projeto para diferentes resoluções de vídeo, então faça assim:
implementation
uses Unit2;//As units usadas por este form devem estar aqui
const
ScreenWidth: LongInt = 800;
ScreenHeight: LongInt = 600;
{$R *.dfm}//A minha resolução base é 800X600, então só funcionará desta resolução para cima, caso utilise 640X480, é substituir.
Depois no OnCreate do Form, use este código
procedure TForm1.FormCreate(Sender: TObject);
begin
scaled := true;
if (screen.width <> ScreenWidth)then
begin
height := longInt(height)*longInt(screen.height) div screenHeight;
width := longint(width)*longInt(screen.width) div screenWidth;
scaleBy(screen.width, ScreenWidth);
end;
end;
implementation
uses Unit2;//As units usadas por este form devem estar aqui
const
ScreenWidth: LongInt = 800;
ScreenHeight: LongInt = 600;
{$R *.dfm}//A minha resolução base é 800X600, então só funcionará desta resolução para cima, caso utilise 640X480, é substituir.
Depois no OnCreate do Form, use este código
procedure TForm1.FormCreate(Sender: TObject);
begin
scaled := true;
if (screen.width <> ScreenWidth)then
begin
height := longInt(height)*longInt(screen.height) div screenHeight;
width := longint(width)*longInt(screen.width) div screenWidth;
scaleBy(screen.width, ScreenWidth);
end;
end;
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)