Cempel Цитата: Как растянуть изображение на странице приветствия и окончания установки?
[more=Вот пример]
[Setup]
AppId={{D137A35A-5F61-41A9-A3ED-143C1DB2A121}
AppName=My Program
AppVersion=1.5
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.Finished1=Игра {#SetupSetting("AppName")} установлена на Ваш компьютер.
rus.Finished2=Нажмите «Завершить», чтобы выйти из программы установки.
[Files]
Source: img1.bmp; Flags: dontcopy
Source: img2.bmp; Flags: dontcopy
[Code]
var MainImage : TBitmapImage;
FinishedImage: TBitmapImage;
WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel: TLabel; //Надписи на на странице приветствия и на финишной странице
procedure InitializeWizard();
begin
ExtractTemporaryFile('img1.bmp');
MainImage := TBitmapImage.Create(WizardForm);
with MainImage do
begin
Parent := WizardForm;
Left := 0;
Top := 0;
Width := 500;
Height := 313;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\img1.bmp'));
end;
ExtractTemporaryFile('img2.bmp');
FinishedImage := TBitmapImage.Create(WizardForm);
with FinishedImage do
begin
Parent := WizardForm;
Left := 0;
Top := 0;
Width := 500;
Height := 313;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\img2.bmp'));
end;
//WelcomePage, создаем надписи на странице
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
Left:= ScaleX(176);
Top:= ScaleY(66);
Width:= ScaleX(301);
Height:= ScaleY(71);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Size:= 14;
Font.Color:=ClWhite
Font.Style := [fsBold]
Parent:= WizardForm;
Font.Name:= 'Georgia'
Caption:= WizardForm.WelcomeLabel1.Caption;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
Top:= ScaleY(136);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(300);
AutoSize:= false;
WordWrap:= true;
Font.Color:=ClWhite
Font.Name:= 'Georgia'
Font.Size:= 10;
Transparent:= true;
Parent:= WizardForm;
Caption:= WizardForm.WelcomeLabel2.Caption;
end;
FinishedHeadingLabel:=TLabel.Create(WizardForm);
with FinishedHeadingLabel do
begin
Top:= ScaleY(66);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(53);
AutoSize:= false;
WordWrap:= true;
Font.Size:= 14;
Font.Color:=ClWhite
Font.Name:= 'Georgia'
Font.Style := [fsBold]
Transparent:= true;
Parent:= WizardForm;
Caption:= WizardForm.FinishedHeadingLabel.Caption;
end;
FinishedLabel:= TLabel.Create(WizardForm);
with FinishedLabel do
begin
Left:= ScaleX(176);
Top:= ScaleY(136);
Width:= ScaleX(301);
Height:= ScaleY(54);
AutoSize:= false;
WordWrap:= true;
Transparent:= true;
Font.Color:=ClWhite
Font.Size:= 10;
Font.Name:= 'Georgia'
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Finished1}') + #10#13#10 + ExpandConstant('{cm:Finished2}')
end;
end;
procedure HideComponents;
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
procedure ShowComponents(CurPageID: Integer);
begin
case CurPageID of
wpWelcome:
begin
WelcomeLabel1.Show
WelcomeLabel2.Show
end;
wpFinished:
begin
FinishedHeadingLabel.Show;
FinishedLabel.Show;
end;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
HideComponents;
ShowComponents(CurPageID);
if CurPageID = wpWelcome then
begin
WizardForm.OuterNotebook.Hide;
FinishedImage.Hide;
end
else if CurPageID = wpFinished then
begin
WizardForm.OuterNotebook.Hide;
MainImage.Hide;
FinishedImage.Show;
end
else WizardForm.OuterNotebook.Show;
end;[/more]