Resolução de Vídeo

Delphi

10/05/2003

Como identificar qual é a resolução de vídeo?

Por exemplo, se for 800x600 executar um comando, mas se for 1024x768 executar outro comando.


Fmd

Fmd

Curtidas 0

Respostas

Marcelo.c

Marcelo.c

10/05/2003

Pelo que entendi o que você precisa está no código abaixo:

Implementation
const
ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
ScreenHeight: LongInt = 600;
{$R *.DFM}
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;


GOSTEI 0
Marcelo.c

Marcelo.c

10/05/2003

Ou, indo direto ao ponto que você precisa:

if (GetSystemMetrics(SM_CXScreen)=640) and GetSystemMetrics (SM_CYScreen)=480) then PagesDlg.WindowState:=wsMaximized;


GOSTEI 0
Fmd

Fmd

10/05/2003

Valeu [b:dfd8df7dfa]marcelo.c[/b:dfd8df7dfa]. Era isso mesmo que eu estava precisando.


GOSTEI 0
POSTAR