Вопрос Как сделать тень?

  • Автор темы Автор темы zettend
  • Дата начала Дата начала
dEf0lT
Какую тень? Где? Для чего? Подробнее, пожалуйста..
 
Если на фоне текста (Вас приветствует бла бла бла....), то очень просто. В Photoshop на рисунке form.png создаешь прямоугольник на новом слое, задаёшь прозрачность слою, сохраняешь. А если на shadow.png то создаешь прямоугольник, применяешь эффект слою тень, настраиваешь без смещения размер тени по вкусу. Или ты что-то другое имел ввиду.
 
Да, я это имел ввиду. Но как это в коде будет выглядить?
 
Я не особо понял что ты именно хочешь.

В ботве можно устанавливать прозрачность в ручную если в самом изображение нету его.
Код:
procedure ImgSetTransparent(img:Longint; Value:integer); external 'ImgSetTransparent@{tmp}\botva2.dll stdcall delayload';
//устанавливает прозрачность изображения
//img   - значение полученное при вызове ImgLoad
//Value - прозрачность (0-255)
1.png
 

Вложения

dEf0lT, пример взят от Metro UI Install


Код:
#include "Modules\botva2.iss"

[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

[Files]
Source: dll\*.dll;                Flags: dontcopy solidbreak nocompression deleteafterinstall;
Source: InstallFiles\*.* ;          Flags: dontcopy solidbreak nocompression deleteafterinstall;

[Code]
#ifdef UNICODE
  #define A "W"
#else
  #define A "A"
#endif

var
Wizard1: Longint;
NewForm: TForm;
MainLabel: TLabel;

function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; X, Y, cx, cy: Integer; uFlags: UINT): BOOL; external 'SetWindowPos@user32.dll stdcall';
function ReleaseCapture: Longint; external 'ReleaseCapture@user32.dll stdcall';

function InitializeSetup:boolean;
begin
  if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
  if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
  Result:=True;
end;

procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  SendMessage(WizardForm.Handle,$0112,$F012,0)
end;

procedure WFProc(h:tobject);
begin
  SetWindowPos(NewForm.Handle, 0, WizardForm.Left-15, WizardForm.Top-15, 0, 0, $515);
end;

procedure InitializeWizard;
var
  rt: TTimer;
  begin
  with WizardForm do begin
  BorderStyle:=bsNone;
  ClientWidth:=750;
  ClientHeight:=442;
  InnerNotebook.Hide;
  OuterNotebook.Hide;
  Center;
  Bevel.Hide;
  NextButton.Width:=0;
  CancelButton.Width:=0;
end;
  NewForm:= TForm.Create(nil);
  NewForm.BorderStyle := bsNone;
  CreateFormFromImage(NewForm.Handle, 'shadow.png');
  rt:= TTimer.create(nil);
  rt.OnTimer:= @WFProc;
  rt.Interval:= 1;
  rt.Enabled:= true;
  NewForm.Show;
  NewForm.Enabled:= False;

  MainLabel:= TLabel.Create(WizardForm);
  with MainLabel do
  begin
  Left:= ScaleX(0);
  Top:= ScaleY(7);
  Width:= ScaleX(750);
  Height:= ScaleY(442);
  AutoSize:= false;
  Transparent:= true;
  WordWrap:= true;
  Font.Name:='Corbel';
  Alignment:= taCenter;
  Parent:= WizardForm;
  OnMouseDown:=@LabelOnMouseDown;
  Caption:= WizardForm.Caption;
end;
end;

procedure DeinitializeSetup();
begin
  gdipShutdown;
end;
 
vint56, доброго вечера. А можно по подробней мне объяснить, что делать. Что-то у меня не получается никак.
Я создал файл shadow.png и положил его в папку InstallFiles. Вставил этот код в скрипт, предварительно исправив размеры изображения на свои. Но при запуске компиляции выскакивает следующая ошибка:
 
Все файлы заменил, но всё равно эта же ошибка осталась. Что-то я не так делаю, а что не пойму.
 
vint56, да, пробовал добавлять в скрипт.
#include "Modules\botva2.iss"
[Setup]
Но, если добавить этот параметр (строку), то выскакивает уже такая ошибка:
 
Danser, у тебя тоже есть этот модуль но в нем нету
procedure CreateFormFromImage(h:HWND; Filename:String);
var
buffer: AnsiString;
FileSize: Longint;
begin
if Pos(ExpandConstant('{tmp}\'), Filename)>0 then StringChange(Filename, ExpandConstant('{tmp}\'), '');
if Pos('{tmp}\', Filename)>0 then StringChange(Filename, '{tmp}\', '');
FileSize:= ExtractTemporaryFileSize(Filename);
SetLength(Buffer, FileSize);
#ifdef UNICODE
ExtractTemporaryFileToBuffer(Filename, CastAnsiStringToInteger(Buffer));
#else
ExtractTemporaryFileToBuffer(Filename, CastStringToInteger(Buffer));
#endif
LibCreateFormFromImage(h, Buffer, FileSize);
end;
посмотри в своем botva2.iss либо просто замени свой модуль на мой
 
vint56, всё заменено как Вы говорили. Вот я чего подумал, может это происходит потому, что я изменил скрипт (шаблон) на другой? Там нет папки dll, а файлы находятся в папке InstallFiles. Но, в принципе, какая разница, просто меняется путь? Или я опять чего не понимаю.
Вот такой код скрипта, может Вы сможете помочь:
Код:
#define GameID "{331582E7-485B-4F59-B2A7-43B71966479D}"

#define NeedSize "10000"

#define NeedMem "512"
#define MyAppName "Brigador"
#define exe "brigador.exe"

  ; Закоментировать для тестового прогона ;
;#define records


#define facompress
;#define precomp "0.38"
;#define PrecompInside
;#define SrepInside
#define unrar
;#define XDelta
;#define PackZIP

#define Registry

; Настройки ;
  ; Splash-рисунок. появляется при запуске инсталятора (Image\Splash.png) ;
  #define Splash

[Setup]
AppId={{#GameID}
AppName={#MyAppName}
AppVersion=1.0
AppPublisher= ооо
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
DirExistsWarning=no
VersionInfoDescription={#MyAppName}
SetupIconFile=Image\icon.ico
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=True
DisableReadyMemo=True


#ifdef Registry
[Registry]
Root: HKLM; Subkey: "Software\FD_Company"; ValueName: "{#MyAppName}"; ValueType: String; ValueData: "{app}"; Check: CheckError
#endif

[Files]
Source: InstallFiles\*; Flags: dontcopy
Source: Image\*; Flags: dontcopy

[Run]
Filename: {src}\Redist\dxwebsetup.exe; WorkingDir: {src}\Redist\; Flags: waituntilterminated; Check: DirectX and CheckError;
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; WorkingDir: {src}\Redist\; Flags: waituntilterminated; Check: visualc and not IsWin64 and CheckError; BeforeInstall: visualcProgress
Filename: {src}\Redist\vcredist_x64.exe; Parameters: /q; WorkingDir: {src}\Redist\; Flags: waituntilterminated; Check: visualc and IsWin64 and CheckError; BeforeInstall: visualcProgress

[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\brigador.exe"; WorkingDir: "{app}"; IconFilename: "{app}\brigador.exe";
Name: "{group}\{#MyAppName}"; Filename: "{app}\brigador.exe"; WorkingDir: "{app}"; IconFilename: "{app}\brigador.exe";
Name: "{group}\{cm:UninstallProgram}"; Filename: "{uninstallexe}"; IconFilename: {app}\cnruninstall.ico;

[UninstallDelete]
Type: FilesAndOrDirs; Name: "{app}"
Type: filesandordirs; Name: "{userdocs}\Syndicate"

[Code]
type
TPBProc = function  (h:hWnd;Msg,wParam,lParam:Longint):Longint;
TALabel = array of TLabel;
var
  SelectTasksPage: TWizardPage;
  NoIconsCheck, hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn,
  DesktopCheck, DirectXCheck, visualcCheck, RedistCheck: HWND;
  WFButtonFont, UPFButtonFont: TFont;
  OldDisk: string;
  DirEditLabel, GroupEditLabel, NoIconsLabel, NeedSpaceLabel, FreeSpaceLabel, StatusLabel, FinishedHeadingLabel,
  WizardUninstLabel, UninstPageDescriptLabel, StatusUninstLabel,
  DesktopLabel, DirectXLabel, visualcLabel, RedistLabel: Tlabel;
  FreeMB, TotalMB: Cardinal;
  ADisk: TALabel;
  WizardImg, Edit: Longint;
  LogoPanel: TPanel;
  Logo: Longint;
  LogoLabel: TLabel;
  LogoImage: TBitmapImage;

//========== [Начало - Подключение модулей] ==========\\
#include "Modules\Messages.iss"
#include "Modules\botva2.iss"
#include "Modules\PB.iss"
#include "Modules\IsDone.iss"

//========== [Конец - Подключение модулей] ==========\\
//========== [Начало - Компаненты страниц] ==========\\

function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function CallBackProc(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallback@{tmp}\callback.dll stdcall delayload';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';

procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';


function NumToStr(Float: Extended): string;
begin
  Result:=Format('%.2n', [Float]);
  StringChange(Result, ',', '.');
  while ((Result[Length(Result)]='0') or (Result[Length(Result)]='.')) and (Pos('.',Result)>0) do SetLength(Result,Length(Result)-1);
end;

function MbOrTB(Float: Extended): string;
begin
  if Float<1024 then Result:=NumToStr(Float)+' MB'
  else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' GB'
  else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' TB'
end;

procedure DiskFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
var
  i:integer;
begin
  for i:= 0 to GetArrayLength(ADisk)-1 do
    if ADisk[i].Font.Color=$FFFFFF then ADisk[i].Font.Color:=$0000FF else ADisk[i].Font.Color:=$FFFFFF;
end;

function GetElementIndex(a:TALabel; lbl:TLabel):integer;
var
  i:integer;
  f:boolean;
begin
  Result:=-1;
  f:=False;
  for i:=0 to GetArrayLength(a)-1 do
    if a[i]=lbl then begin
      f:=True;
      Break;
    end;
  if f then Result:=i;
end;

procedure AddLabelToArray(var a:TALabel; lbl:TLabel);
begin
  if GetElementIndex(a,lbl)=-1 then begin
    SetArrayLength(a,GetArrayLength(a)+1);
    a[GetArrayLength(a)-1]:=lbl;
  end;
end;

procedure DeleteLabelFromArray(var a:TALabel; lbl:integer);
var
  Last,i:integer;
begin
  if lbl<>-1 then begin
    Last:=GetArrayLength(a)-1;
    if lbl<Last then
      for i:=lbl to Last-1 do a[i]:=a[i+1];
    SetArrayLength(a,Last);
  end;
end;

procedure GetFreeSpaceCaption(Sender: TObject);
var
  CurrentDisk: String;
  i:integer;
begin
  CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text);
  DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
  if not GetSpaceOnDisk(CurrentDisk,True,FreeMB,TotalMB) then begin
    SetArrayLength(ADisk,0);
    FreeSpaceLabel.Visible:=False;
    BtnSetEnabled(hNextBtn,False);
    WizardForm.NextButton.Enabled:=False;
    OldDisk:=CurrentDisk;
    Exit;
  end;

  FreeSpaceLabel.Visible:=True;

  if CurrentDisk<>OldDisk then begin
    OldDisk:=CurrentDisk;
    FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace} ') + MbOrTB(FreeMb) + ' (' + IntToStr((FreeMb*100) div TotalMB) + ' %)';

    if WizardForm.CurPageID = wpWelcome then begin
      if FreeMB>={#NeedSize} then begin
        i:=GetElementIndex(ADisk,FreeSpaceLabel);
        if i<>-1 then begin
          DeleteLabelFromArray(ADisk,i);
          FreeSpaceLabel.Font.Color:=$FFFFFF;
        end;
      end else AddLabelToArray(ADisk,FreeSpaceLabel);

      BtnSetEnabled(hNextBtn,not (GetArrayLength(ADisk)>0));
      WizardForm.NextButton.Enabled:=not (GetArrayLength(ADisk)>0);
    end;
  end;
end;

procedure SetStateNewButtons;
begin
  with WizardForm.BackButton do begin
    BtnSetText(hBackBtn,PAnsiChar(Caption));
    BtnSetVisibility(hBackBtn,Visible);
    BtnSetEnabled(hBackBtn,Enabled);
  end;
  with WizardForm.NextButton do begin
    BtnSetText(hNextBtn,PAnsiChar(Caption));
    BtnSetVisibility(hNextBtn,Visible);
    BtnSetEnabled(hNextBtn,Enabled);
  end;
  with WizardForm.CancelButton do begin
    BtnSetText(hCancelBtn,PAnsiChar(Caption));
    BtnSetVisibility(hCancelBtn,Visible);
    BtnSetEnabled(hCancelBtn,Enabled);
  end;
  BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
end;

procedure WizardFormBtnClick(hBtn:HWND);
var
  Btn:TButton;
begin
  case hBtn of
    hCancelBtn: Btn:=WizardForm.CancelButton;
    hNextBtn: Btn:=WizardForm.NextButton;
    hBackBtn: Btn:=WizardForm.BackButton;
    hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
  end;
  Btn.OnClick(Btn);
  SetStateNewButtons;
  BtnRefresh(hBtn);
end;

procedure WFBtnEnter(hBtn:HWND);
begin
end;

function NoIcons: Boolean;
begin
  Result:= BtnGetChecked(NoIconsCheck);
end;

procedure NoIconsClick(hBtn:HWND);
begin
  if BtnGetChecked(hBtn) then NoIconsLabel.Font.Color:=$FFFFFF else NoIconsLabel.Font.Color:=$B5B5B5;
end;

procedure NoIconsLabelClick(Sender:TObject);
begin
  BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
  NoIconsClick(NoIconsCheck);
end;

function Redist: Boolean;
begin
  Result:= BtnGetChecked(RedistCheck);
end;

function DirectX: Boolean;
begin
  Result:= BtnGetChecked(DirectXCheck);
end;

function Visualc: Boolean;
begin
  Result:= BtnGetChecked(VisualcCheck);
end;

function Desktop: Boolean;
begin
  Result:= BtnGetChecked(DesktopCheck);
end;

procedure DesktopClick(hBtn:HWND);
begin
  if BtnGetChecked(hBtn) then DesktopLabel.Font.Color:=$FFFFFF else DesktopLabel.Font.Color:=$B5B5B5;
end;

procedure DesktopLabelClick(Sender:TObject);
begin
  BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
  DesktopClick(DesktopCheck);
end;

procedure RedistClick(hBtn:HWND);
begin
  if BtnGetChecked(RedistCheck) then BtnSetChecked(DirectXCheck, True) else BtnSetChecked(DirectXCheck, False);
  if BtnGetChecked(RedistCheck) then BtnSetChecked(visualcCheck, True) else BtnSetChecked(visualcCheck, False);
  if BtnGetChecked(RedistCheck) then DirectXLabel.Font.Color:=$FFFFFF else DirectXLabel.Font.Color:=$B5B5B5;
  if BtnGetChecked(RedistCheck) then visualcLabel.Font.Color:=$FFFFFF else visualcLabel.Font.Color:=$B5B5B5;
  if BtnGetChecked(hBtn) then RedistLabel.Font.Color:=$FFFFFF else RedistLabel.Font.Color:=$B5B5B5;
end;

procedure RedistLabelClick(Sender:TObject);
begin
  BtnSetChecked(RedistCheck, not BtnGetChecked(RedistCheck));
  RedistClick(RedistCheck);
end;

procedure DirectXClick(hBtn:HWND);
begin
  if BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
  if BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) then RedistLabel.Font.Color:=$FFFFFF else RedistLabel.Font.Color:=$B5B5B5;
  if BtnGetChecked(hBtn) then DirectXLabel.Font.Color:=$FFFFFF else DirectXLabel.Font.Color:=$B5B5B5;
end;

procedure DirectXLabelClick(Sender:TObject);
begin
  BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck));
  DirectXClick(DirectXCheck);
end;

procedure visualcClick(hBtn:HWND);
begin
  if BtnGetChecked(visualcCheck) or BtnGetChecked(DirectXCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
  if BtnGetChecked(visualcCheck) or BtnGetChecked(DirectXCheck) then RedistLabel.Font.Color:=$FFFFFF else RedistLabel.Font.Color:=$B5B5B5;
  if BtnGetChecked(hBtn) then visualcLabel.Font.Color:=$FFFFFF else visualcLabel.Font.Color:=$B5B5B5;
end;

procedure visualcLabelClick(Sender:TObject);
begin
  BtnSetChecked(visualcCheck, not BtnGetChecked(visualcCheck));
  visualcClick(visualcCheck);
end;

procedure DirectXProgress;
begin
  StatusLabel.Caption:=ExpandConstant('{cm:DirectXInstall}')
end;
procedure VisualcProgress;
begin
  StatusLabel.Caption:=ExpandConstant('{cm:VisualcInstall}')
end;

procedure ObjectFunc(Sender: TObject);
var
  Drive: String;
begin
  case Sender of
    WizardForm.DirEdit: begin
      Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
      DirEditLabel.Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
    end;
   WizardForm.GroupEdit: begin
      GroupEditLabel.Caption:= WizardForm.GroupEdit.Text;
    end;
end;
end;
#ifdef Splash
procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
#endif
procedure Splash();
begin
  #ifdef Splash
    ExtractTemporaryFile('Splash.png');
    ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\Splash.png',1000,3000,1000,0,255,False,$FFFFFF,10);
  #endif
end;
function CheckError: Boolean;
begin
  Result:= not ISDoneError;
end;

function InitializeSetup: Boolean;
begin
  #ifdef Splash
  ExtractTemporaryFile('Splash.png');
  #endif
  ExtractTemporaryFile('Logo.jpg');
  ExtractTemporaryFile('botva2.dll');
  ExtractTemporaryFile('b2p.dll');
  ExtractTemporaryFile('CallbackCtrl.dll');
  ExtractTemporaryFile('skin.cjstyles');
  LoadSkin(ExpandConstant('{tmp}\skin.cjstyles'), '');
  Result:=True;
end;

//========== [Конец - Компаненты страниц] ==========\\

//========== [Начало - Создание формы] ==========\\
procedure CreateWizardForm;
var
  i: Integer;
begin
with WizardForm do begin
  ClientWidth:=ScaleX(375);
  ClientHeight:=ScaleY(460);
  Center;
  OuterNotebook.Hide;
  InnerNotebook.Hide;
  Bevel.Hide;
  GroupEdit.OnChange:= @ObjectFunc
end;
   ExtractTemporaryFile('pbbkg.png');

  WizardImg:=ImgLoad(WizardForm.Handle,ExpandConstant('WizardImage.png'),ScaleX(0),ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
  Logo:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Logo.jpg'),ScaleX(10), ScaleY(5),ScaleX(355),ScaleY(145),True,True);
  Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\pbbkg.png'),ScaleX(15), ScaleY(159),ScaleX(265),ScaleY(23),True,True);

  //========== [Конец - Создание формы] ==========\\

  //========== [Начало - Выбор папки] ==========\\
  DirEditLabel:=Tlabel.Create(wizardform);
  with DirEditLabel do begin
    Parent := WizardForm;
    AutoSize:=False;
    Transparent := True;
    SetBounds(ScaleX(20), ScaleY(162), ScaleX(250), ScaleY(20));
    Font.Name:= 'Tahoma';
    Font.Size:= 9;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
  end;

  FreeSpaceLabel := TLabel.Create(WizardForm);
  with FreeSpaceLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(15), ScaleY(210), ScaleX(285), ScaleY(20));
    Transparent:=True;
    Font.Name:= 'Tahoma';
    Font.Size:= 8;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Parent := WizardForm;
  end;

  NeedSpaceLabel := TLabel.Create(WizardForm);
  with NeedSpaceLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(15), ScaleY(190), ScaleX(300), ScaleY(20));
    Transparent:=True;
    Font.Name:= 'Tahoma';
    Font.Size:= 8;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTB({#NeedSize});
    Parent := WizardForm;
  end;
    WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
    WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text;
  //========== [Конец - Выбор папки] ==========\\

  //========== [Начало - Задачи] ==========\\
  GroupEditLabel:=Tlabel.Create(wizardform);
  with GroupEditLabel do begin
    Parent := WizardForm;
    AutoSize:=False;
    Transparent := True;
    SetBounds(ScaleX(15), ScaleY(280), ScaleX(280), ScaleY(20));
    Font.Name:= 'Tahoma';
    Font.Size:= 10;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Caption := WizardForm.GroupEdit.Text;
  end;

  NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(18),ScaleY(162),ScaleX(19),ScaleY(19),ExpandConstant('CheckBox.png'),8,True);
  BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
  BtnSetEvent(NoIconsCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(NoIconsCheck,GetSysCursorHandle(32649));
  BtnSetChecked(NoIconsCheck,True);

  NoIconsLabel := TLabel.Create(WizardForm);
  with NoIconsLabel do begin
    Parent:=WizardForm;
    AutoSize:=true;
    Transparent:=True;
    SetBounds(ScaleX(40), ScaleY(163), ScaleX(0), ScaleY(0));
    Font.Name:= 'Tahoma'
    Font.Size:= 9;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:NoIconsCheck}');
    Cursor := crHand;
    OnClick:= @NoIconsLabelClick;
  end;

  SelectTasksPage := CreateCustomPage(wpSelectProgramGroup, ExpandConstant('{cm:TasksName}'), ExpandConstant('{cm:TasksDescription}'));

  DesktopCheck:=BtnCreate(WizardForm.Handle,ScaleX(18),ScaleY(182),ScaleX(19),ScaleY(19),ExpandConstant('CheckBox.png'),8,True);
  BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
  BtnSetEvent(DesktopCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(DesktopCheck,GetSysCursorHandle(32649));
  BtnSetChecked(DesktopCheck,True);

  DesktopLabel := TLabel.Create(WizardForm);
  with DesktopLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(40), ScaleY(183), ScaleX(225), ScaleY(17));
    OnClick:= @DesktopLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 9;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:Desktop}');
    Parent := WizardForm;
  end;

  RedistCheck:=BtnCreate(WizardForm.Handle,ScaleX(18),ScaleY(207),ScaleX(19),ScaleY(19),ExpandConstant('CheckBox.png'),8,True);
  BtnSetEvent(RedistCheck,BtnClickEventID,WrapBtnCallback(@RedistClick,1));
  BtnSetEvent(RedistCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(RedistCheck,GetSysCursorHandle(32649));
  BtnSetChecked(RedistCheck, False);

  RedistLabel := TLabel.Create(WizardForm);
  with RedistLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(40), ScaleY(208), ScaleX(299), ScaleY(17));
    OnClick:= @RedistLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 9;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:Redist}');
    Parent := WizardForm;
  end;

  DirectXCheck:=BtnCreate(WizardForm.Handle,ScaleX(28),ScaleY(227),ScaleX(19),ScaleY(19),ExpandConstant('CheckBox.png'),8,True);
  BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
  BtnSetEvent(DirectXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649));
  BtnSetChecked(DirectXCheck, False);

  DirectXLabel := TLabel.Create(WizardForm);
  with DirectXLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(50), ScaleY(228), ScaleX(120), ScaleY(17));
    OnClick:= @DirectXLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 9;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:DirectX}');
    Parent := WizardForm;
  end;

  VisualCCheck:=BtnCreate(WizardForm.Handle,ScaleX(28),ScaleY(247),ScaleX(19),ScaleY(19),ExpandConstant('CheckBox.png'),8,True);
  BtnSetEvent(VisualCCheck,BtnClickEventID,WrapBtnCallback(@VisualCClick,1));
  BtnSetEvent(VisualCCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(VisualCCheck,GetSysCursorHandle(32649));
  BtnSetChecked(VisualCCheck, False);

  VisualCLabel := TLabel.Create(WizardForm);
  with VisualCLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(50), ScaleY(248), ScaleX(195), ScaleY(17));
    OnClick:= @VisualCLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 9;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:VisualC}');
    Parent := WizardForm;
  end;
  //========== [Конец - Задачи] =========\\

  //========== [Начало - Установка] ==========\\
  IsDoneAddComponents

  StatusLabel:= TLabel.Create(WizardForm);
  with StatusLabel do begin
    Parent := WizardForm;
    AutoSize:=True;
    Transparent := True;
    SetBounds(ScaleX(55), ScaleY(225), ScaleX(0), ScaleY(0));
    Font.Name:='Tahoma';
    Font.Size:= 9;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Caption:=ExpandConstant('{cm:Extracted}');
  end;
  //========== [Конец - Установка] ==========\\

  //========== [Начало - Завершить] ==========\\
  FinishedHeadingLabel:= TLabel.Create(WizardForm);
  with FinishedHeadingLabel do begin
    Parent:=WizardForm;
    AutoSize:=False;
    Transparent:=True;
    SetBounds(ScaleX(15), ScaleY(225), ScaleX(346), ScaleY(120));
    Font.Name:= 'Tahoma';
    Font.Size:= 9;
    Font.Color:=$B5B5B5;
    Font.Style:=[fsBold];
    Alignment := taCenter;
    Caption:=ExpandConstant('{cm:FinishedHeadingLabel}');
  end;
end;
  //========== [Конец - Завершить] ==========\\

  //========== [Начало - Текстуры кнопок] ==========\\
procedure ButtonsTextures;
begin
  WFButtonFont:=TFont.Create;
  WFButtonFont.Style:=[fsBold];

  with WizardForm.BackButton do begin
    hBackBtn:=BtnCreate(WizardForm.Handle,ScaleX(105), ScaleY(420), ScaleX(81), ScaleY(40),ExpandConstant('btn.png'),0,False);
    BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hBackBtn,WFButtonFont.Handle);
    BtnSetFontColor(hBackBtn,$B5B5B5,$B5B5B5,$B5B5B5,$B5B5B5);
    BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;

  with WizardForm.NextButton do begin
    hNextBtn:=BtnCreate(WizardForm.Handle,ScaleX(195), ScaleY(420), ScaleX(81), ScaleY(40),ExpandConstant('btn.png'),0,False);
    BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hNextBtn,WFButtonFont.Handle);
    BtnSetFontColor(hNextBtn,$B5B5B5,$B5B5B5,$B5B5B5,$B5B5B5);
    BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;

  with WizardForm.CancelButton do begin
    hCancelBtn:=BtnCreate(WizardForm.Handle,ScaleX(285), ScaleY(420), ScaleX(81), ScaleY(40),ExpandConstant('btn.png'),0,False);
    BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hCancelBtn,WFButtonFont.Handle);
    BtnSetFontColor(hCancelBtn,$B5B5B5,$B5B5B5,$B5B5B5,$B5B5B5);
    BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;

  with WizardForm.DirBrowseButton do begin
    hDirBrowseBtn:=BtnCreate(WizardForm.Handle,ScaleX(285), ScaleY(150), ScaleX(81), ScaleY(40),ExpandConstant('btn.png'),0,False);
    BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
    BtnSetFontColor(hDirBrowseBtn,$B5B5B5,$B5B5B5,$B5B5B5,$B5B5B5);
    BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;

end;
  //========== [Конец - Текстуры кнопок] ==========\\

  //========== [Начало - Прячем компоненты] ==========\\
procedure HideComponents;
begin;
  DirEditLabel.Hide;
  GroupEditLabel.Hide;
  BtnSetVisibility(hDirBrowseBtn,False);
  BtnSetVisibility(DesktopCheck,False);
  BtnSetVisibility(RedistCheck,False);
  BtnSetVisibility(DirectXCheck,False);
  BtnSetVisibility(VisualCCheck,False);
  BtnSetVisibility(NoIconsCheck,False);
  FreeSpaceLabel.Hide;
  NeedSpaceLabel.Hide;
  IsDoneHide;
  StatusLabel.Hide;
  FinishedHeadingLabel.Hide;
  DesktopLabel.Hide;
  RedistLabel.Hide;
  DirectXLabel.Hide;
  VisualCLabel.Hide;
  NoIconsLabel.Hide;
end;
  //========== [Конец - Прячем компоненты] ==========\\

  //========== [Начало - Показываем компоненты] ==========\\
procedure ShowComponents(CurPageID: Integer);
begin
  case CurPageID of
    wpWelcome:
    begin
      DirEditLabel.Show;
      BtnSetVisibility(hDirBrowseBtn,True);
      FreeSpaceLabel.Show;
      NeedSpaceLabel.Show;
      ImgSetVisibility(Edit,True);
    end;

    SelectTasksPage.ID:
    begin
      NoIconsLabel.Show;
      BtnSetVisibility(NoIconsCheck,True);
      BtnSetVisibility(DesktopCheck,True);
      BtnSetVisibility(RedistCheck,True);
      BtnSetVisibility(DirectXCheck,True);
      BtnSetVisibility(VisualCCheck,True);
      DesktopLabel.Show;
      RedistLabel.Show;
      DirectXLabel.Show;
      VisualCLabel.Show;
      WizardForm.NextButton.Caption:=SetupMessage(msgButtonInstall);
    end;

    wpInstalling:
    begin
      StatusLabel.Show;
      IsDoneShow();
    end;

    wpFinished:
    begin
      FinishedHeadingLabel.Show;
    end;
  end;
end;
  //========== [Конец - Показываем компоненты] ==========\\

procedure LogoCreate;
begin
  ImgSetVisibility(Logo,True);
end;

procedure InitializeWizard;
begin
  WizardForm.Position:=poScreenCenter;
  CreateWizardForm;
  ButtonsTextures;
  #ifdef Splash
  Splash;
  #endif
  LogoCreate;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  HideComponents;
  ImgSetVisibility(Edit,False);
  ShowComponents(CurPageID);
  ImgApplyChanges(WizardForm.Handle);
  SetStateNewButtons;

if CurPageID=wpWelcome then
  begin
   OldDisk:='';
   GetFreeSpaceCaption(nil);
  end;

if (CurPageID = wpFinished) and ISDoneError then begin
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    FinishedHeadingLabel.Font.Color:= $0000FF;
    FinishedHeadingLabel.Caption:= ExpandConstant('{cm:ErrorFinishedHeadingLabel}');
    DelTree(ExpandConstant('{app}'), True, True, True);
  end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  IsDoneUnpack(CurStep);
end;

procedure DeinitializeSetup;
begin
  gdipShutdown;
  UnloadSkin();
end;
 
Danser, выкладывай с файлами посмотрю но есть проблема у тебя используется скин он может все тень перекрыть
 
vint56, спасибо за помощь. Но я хотел маленько не то, получается, что Splash-рисунок появляется вместе с теневой основой окна установки, а само окно установки позже. Или, это то, о чем Вы предупреждали? Это не исправить, или заставка или тень?
у тебя используется скин он может все тень перекрыть
---
UPD: Благодарю Вас за помощь, Ваш исправленный код сохраню, может, я сам позже попробую создать свой собственный скрипт (и тут он мне пригодится), а не использовать чужой.
 
Последнее редактирование:
Внимание: заранее я понимаю что использую библиотеку не по назначению(но вроде этот работает).

Здравствуйте, пытаясь найти решение по применению тени к инсталлятору, нашел три способа. Два из которых связаны с процедурой CreateFormFromImage из Botva 2(практически схожи и имеют нюансы), а третий попалась библиотека мне Fairy.dll. Собственно вопрос ко всем неравнодушным, пожалуйста расскажите какие у нее недостатки по Вашему мнению и опыту. Я гуглил и читал статьи на форумах, поговаривают что не стабильная она (библиотека), но в чем нестабильная вопрос.
Библиотека подкупила меня тем что накладывается на окно инталлятора вроде без задержек и без артефактов в графике, а так же вроде без задержки в анимации при передвижении.

Собственно я не с пустыми руками, вот пример что у меня получилось на скорую руку:

7.png

Заранее спасибо...
 

Вложения

Последнее редактирование:
Назад
Сверху