resoluções de video diferente(erro!)
estou querendo implementar resoluções de video diferente, porem tem um detalhe do codigo abaixo que da erro no delphi...
1- ´[color=red:cb1b31cf0d]scaleyBy[/color:cb1b31cf0d]´ : o delphi diz: undeclared identifier.
2- USES [color=blue:cb1b31cf0d]tyinfo[/color:cb1b31cf0d]; {colocar na clausula uses.}: o delpfi diz: file not found: ´tyinfo.dcu´
o que eu fasso agora??? :?:
:arrow: abaixo segue o codigo:
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;
[color=red:cb1b31cf0d] scaleyBy(screen.width, ScreenWidth);[/color:cb1b31cf0d] end;
end;
Agora, você vai querer checar, se o tamanho dos fontes(de letra) estão
OK. Antes de trocar p tamanho do fonte, você precisará ter
certeza de que o objeto realmente tem a propriedade fonte pela checagem
da RTTI. Isso pode ser feito assim:
[color=blue:cb1b31cf0d]USES tyinfo; {colocar na clausula uses.}[/color:cb1b31cf0d]
var
i:integer;
begin
for i := componentCount - 1 downto 0 do
with components[i] do
begin
if GetPropInfo(ClassInfo, ´font´) <> nil then
font.size := (NewFormWidth DIV OldFormWidth) * font.size;
end;
end;
1- ´[color=red:cb1b31cf0d]scaleyBy[/color:cb1b31cf0d]´ : o delphi diz: undeclared identifier.
2- USES [color=blue:cb1b31cf0d]tyinfo[/color:cb1b31cf0d]; {colocar na clausula uses.}: o delpfi diz: file not found: ´tyinfo.dcu´
o que eu fasso agora??? :?:
:arrow: abaixo segue o codigo:
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;
[color=red:cb1b31cf0d] scaleyBy(screen.width, ScreenWidth);[/color:cb1b31cf0d] end;
end;
Agora, você vai querer checar, se o tamanho dos fontes(de letra) estão
OK. Antes de trocar p tamanho do fonte, você precisará ter
certeza de que o objeto realmente tem a propriedade fonte pela checagem
da RTTI. Isso pode ser feito assim:
[color=blue:cb1b31cf0d]USES tyinfo; {colocar na clausula uses.}[/color:cb1b31cf0d]
var
i:integer;
begin
for i := componentCount - 1 downto 0 do
with components[i] do
begin
if GetPropInfo(ClassInfo, ´font´) <> nil then
font.size := (NewFormWidth DIV OldFormWidth) * font.size;
end;
end;
Mahdak
Curtidas 0
Respostas
Rômulo Barros
17/03/2004
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,[color=red] DesignIntf[/color];
type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
const
ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
ScreenHeight: LongInt = 600;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
Var
I : Integer;
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;
[color=red]ScaleBy[/color](screen.width, ScreenWidth);
end;
for i := componentCount - 1 downto 0 do
with components[i] do
begin
if GetPropInfo(ClassInfo, ´font´) <> nil then
font.size := (NewFormWidth DIV OldFormWidth) * font.size;
end;
end;
end.GOSTEI 0
Mahdak
17/03/2004
SOBE
------
OK!, MAS NAO DEU AINDA, AGORA AO INVES DE :
FILE NOT FOUND: tyinfo.DCU , ELE DA
FILE NOT FOUND: DesignIntf.DCU
:arrow: :?:
------
OK!, MAS NAO DEU AINDA, AGORA AO INVES DE :
FILE NOT FOUND: tyinfo.DCU , ELE DA
FILE NOT FOUND: DesignIntf.DCU
:arrow: :?:
GOSTEI 0
Mahdak
17/03/2004
sobe
------
nao consegui ainda
------
nao consegui ainda
GOSTEI 0
Gandalf.nho
17/03/2004
Qual a versão do seu Delphi?
GOSTEI 0
Mahdak
17/03/2004
sobe
------
borland delphi 7 vs studio
------
borland delphi 7 vs studio
GOSTEI 0