New UberSplash by Vince
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@901 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0bb9e63724
commit
3a2b46e2d4
5 changed files with 287 additions and 0 deletions
13
Contrib/UberSplash/UberSplash.txt
Normal file
13
Contrib/UberSplash/UberSplash.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
File /oname=bitmap.bmp "C:\pathto\bitmap.bmp"
|
||||
File /oname=splash.exe "${NSISDIR}\Bin\UberSplash.exe"
|
||||
ExecWait '"$TEMP\splash.exe" bitmap.bmp FADEINSTEP MILLISECONDSHOW FADEOUTSTEP'
|
||||
|
||||
FADEINSTEP and FADEOUTSTEP between 0 and 255
|
||||
|
||||
supports magiclime and the alpha fading
|
||||
for a display and die.. [no fade]
|
||||
ExecWait '"$TEMP\splash.exe" bitmap.bmp 0 MILLISECONDSHOW 0'
|
||||
win95 and win98 just display for full length
|
||||
|
||||
code by vince
|
||||
idea by snowchyld
|
40
Contrib/UberSplash/splash.cfg
Normal file
40
Contrib/UberSplash/splash.cfg
Normal file
|
@ -0,0 +1,40 @@
|
|||
-$A8
|
||||
-$B-
|
||||
-$C-
|
||||
-$D+
|
||||
-$E-
|
||||
-$F-
|
||||
-$G+
|
||||
-$H+
|
||||
-$I+
|
||||
-$J+
|
||||
-$K-
|
||||
-$L+
|
||||
-$M-
|
||||
-$N+
|
||||
-$O+
|
||||
-$P+
|
||||
-$Q-
|
||||
-$R-
|
||||
-$S-
|
||||
-$T-
|
||||
-$U-
|
||||
-$V+
|
||||
-$W-
|
||||
-$X+
|
||||
-$YD
|
||||
-$Z1
|
||||
-cg
|
||||
-AClasses=;mirror=
|
||||
-H+
|
||||
-W+
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-LE"f:\program files\borland\delphi6\Projects\Bpl"
|
||||
-LN"f:\program files\borland\delphi6\Projects\Bpl"
|
||||
-U"f:\kol;f:\kol\sys"
|
||||
-O"f:\kol;f:\kol\sys"
|
||||
-I"f:\kol;f:\kol\sys"
|
||||
-R"f:\kol;f:\kol\sys"
|
||||
-DKOL_MCK
|
BIN
Contrib/UberSplash/splash.dcu
Normal file
BIN
Contrib/UberSplash/splash.dcu
Normal file
Binary file not shown.
96
Contrib/UberSplash/splash.dof
Normal file
96
Contrib/UberSplash/splash.dof
Normal file
|
@ -0,0 +1,96 @@
|
|||
[FileVersion]
|
||||
Version=6.0
|
||||
[Compiler]
|
||||
A=8
|
||||
B=0
|
||||
C=0
|
||||
D=1
|
||||
E=0
|
||||
F=0
|
||||
G=1
|
||||
H=1
|
||||
I=1
|
||||
J=1
|
||||
K=0
|
||||
L=1
|
||||
M=0
|
||||
N=1
|
||||
O=1
|
||||
P=1
|
||||
Q=0
|
||||
R=0
|
||||
S=0
|
||||
T=0
|
||||
U=0
|
||||
V=1
|
||||
W=0
|
||||
X=1
|
||||
Y=1
|
||||
Z=1
|
||||
ShowHints=1
|
||||
ShowWarnings=1
|
||||
UnitAliases=Classes=;mirror=
|
||||
[Linker]
|
||||
MapFile=0
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
RemoteSymbols=0
|
||||
MinStackSize=16384
|
||||
MaxStackSize=1048576
|
||||
ImageBase=4194304
|
||||
ExeDescription=_KOL_ mirror controls
|
||||
[Directories]
|
||||
OutputDir=
|
||||
UnitOutputDir=
|
||||
PackageDLLOutputDir=
|
||||
PackageDCPOutputDir=
|
||||
SearchPath=f:\kol;f:\kol\sys
|
||||
Packages=Vcl50;Vclx50;VclSmp50
|
||||
Conditionals=KOL_MCK
|
||||
DebugSourceDirs=f:\kol
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
RunParams=b2.bmp
|
||||
HostApplication=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1049
|
||||
CodePage=1251
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=2
|
||||
Item0=f:\kol
|
||||
Item1=e:\kol
|
||||
[HistoryLists\hlConditionals]
|
||||
Count=1
|
||||
Item0=KOL_MCK
|
||||
[HistoryLists\hlUnitAliases]
|
||||
Count=1
|
||||
Item0=Classes=;mirror=
|
||||
[HistoryLists\hlSearchPath]
|
||||
Count=2
|
||||
Item0=f:\kol;f:\kol\sys
|
||||
Item1=e:\kol;e:\kol\sys
|
138
Contrib/UberSplash/splash.dpr
Normal file
138
Contrib/UberSplash/splash.dpr
Normal file
|
@ -0,0 +1,138 @@
|
|||
{****************************************}
|
||||
Program splash;
|
||||
|
||||
uses
|
||||
Windows,
|
||||
Kol;
|
||||
|
||||
type
|
||||
PByteArray = ^TByteArray;
|
||||
TByteArray = array[0..32767] of Byte;
|
||||
var
|
||||
Applet, {A main form or application}
|
||||
PaintBox : pControl; {A simple static paintbox}
|
||||
BitMap : pBitmap; {A bitmap}
|
||||
i,j,j2,wait,inSpd,outSpd : Word; {temp values...}
|
||||
WindowRgn, RowRgn : HRGN; {Regions for transparency}
|
||||
FadeIn,FadeOut : pTimer; {Timers...}
|
||||
FadeInFlag : Boolean; {Switch Fade In/Out Flag}
|
||||
ScannedLine : PByteArray; {Array for RGB data from BitMap}
|
||||
|
||||
//This handles the OnPaint event from the Paintbox It draws the bitmap on the PaintBox's Canvas
|
||||
procedure paint(dummy:pointer;sender:pcontrol;DC:HDC);
|
||||
begin
|
||||
Bitmap.Draw(DC,0,0);
|
||||
end;
|
||||
|
||||
procedure FadeInAlpha(Sender: PObj);
|
||||
begin
|
||||
if FadeInFlag then
|
||||
if Applet.AlphaBlend < (255 - inSpd) then Applet.AlphaBlend := Applet.AlphaBlend + inSpd;
|
||||
if not FadeInFlag then begin
|
||||
if Applet.AlphaBlend > outSpd then Applet.AlphaBlend := Applet.AlphaBlend - outSpd;
|
||||
if Applet.AlphaBlend < outSpd + 1 then begin
|
||||
Applet.AlphaBlend := 0;
|
||||
Applet.Close;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure FadeOutAlpha(Sender: PObj);
|
||||
begin
|
||||
if Applet.AlphaBlend > inSpd then
|
||||
FadeInFlag := False
|
||||
else begin
|
||||
Applet.AlphaBlend := 0;
|
||||
Applet.Close;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
if ParamStr(1) <> '' then begin
|
||||
if ParamStr(2) = '' then inSpd := 5 else inSpd := Str2Int(ParamStr(2));
|
||||
if ParamStr(3) = '' then wait := 2000 else wait := Str2Int(ParamStr(3));
|
||||
if ParamStr(4) = '' then outSpd := 25 else outSpd := Str2Int(ParamStr(4));
|
||||
end
|
||||
else begin
|
||||
if ParamStr(2) = '' then inSpd := 1 else inSpd := Str2Int(ParamStr(2));
|
||||
if ParamStr(3) = '' then wait := 1 else wait := Str2Int(ParamStr(3));
|
||||
if ParamStr(4) = '' then outSpd := 1 else outSpd := Str2Int(ParamStr(4));
|
||||
end;
|
||||
|
||||
{Create the form}
|
||||
Applet:=NewForm(nil,'').SetSize(0,0);
|
||||
Applet.CenterOnParent;
|
||||
Applet.Visible := False;
|
||||
Applet.AlphaBlend := 0;
|
||||
Applet.Style := WS_POPUP;
|
||||
Applet.HasBorder := False;
|
||||
Applet.Border := 0;
|
||||
Applet.Color := clBlack;
|
||||
|
||||
|
||||
{Create the bitmap itself}
|
||||
BitMap:=NewBitMap(0,0);
|
||||
BitMap.Clear;
|
||||
//LoadFromFile has built in error checking...
|
||||
if ParamStr(1) <> '' then BitMap.LoadFromFile(ParamStr(1));
|
||||
|
||||
{Create the Paintbox to draw the bitmap on}
|
||||
PaintBox:=NewPaintbox(Applet).setalign(caClient);
|
||||
PaintBox.Width:=BitMap.Width;
|
||||
PaintBox.Height:=BitMap.Height;
|
||||
PaintBox.OnPaint:=TOnPaint(MakeMethod(nil,@Paint));
|
||||
|
||||
{Do some housekeeping}
|
||||
Applet.ClientHeight:=Bitmap.Height+10;
|
||||
Applet.ClientWidth :=Bitmap.Width+10;
|
||||
Applet.Top := Applet.Top - Applet.Height div 2;
|
||||
Applet.Left := Applet.Left - Applet.Width div 2;
|
||||
|
||||
|
||||
{Cut out magic color}
|
||||
WindowRgn := CreateRectRgn(0,0,0,0);
|
||||
for i:= 0 to BitMap.Height - 1 do begin
|
||||
ScannedLine := BitMap.ScanLine[i];
|
||||
j := 0;
|
||||
while (j < BitMap.Width - 1) do begin
|
||||
if ((ScannedLine[j * 3 + 2]*256*256)+(ScannedLine[j * 3 + 1]*256)+ScannedLine[j * 3] = clLime) then j := j + 1
|
||||
else begin
|
||||
j2 := j;
|
||||
while (j2 < BitMap.Width - 1) and ((ScannedLine[j2 * 3 + 2]*256*256)+(ScannedLine[j2 * 3 + 1]*256)+ScannedLine[j2 * 3] <> clLime) do j2 := j2 + 1;
|
||||
RowRgn := CreateRectRgn(j,i,j2,i+1);
|
||||
CombineRgn(WindowRgn, WindowRgn, RowRgn, RGN_OR);
|
||||
DeleteObject(RowRgn);
|
||||
j := j2;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
SetWindowRgn(Applet.Handle,WindowRgn,true);
|
||||
|
||||
//remove taskbar icon and get ready to rock...
|
||||
ShowWindow(Applet.Handle, SW_HIDE);
|
||||
SetWindowLong(Applet.Handle, GWL_EXSTYLE,GetWindowLong(Applet.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
|
||||
ShowWindow(Applet.Handle, SW_SHOW);
|
||||
ShowWindow(Applet.Handle, SW_SHOWDEFAULT);
|
||||
BringWindowToTop(Applet.GetWindowHandle);
|
||||
Applet.DoSetFocus;
|
||||
Applet.StayOnTop := True;
|
||||
Applet.Visible := True;
|
||||
|
||||
{start timers}
|
||||
FadeInFlag := True;
|
||||
|
||||
FadeIn := NewTimer(2);
|
||||
FadeIn.OnTimer := TOnEvent(MakeMethod(nil,@FadeInAlpha));
|
||||
FadeIn.Enabled := True;
|
||||
|
||||
FadeOut := NewTimer(wait);
|
||||
FadeOut.OnTimer := TOnEvent(MakeMethod(nil,@FadeOutAlpha));
|
||||
FadeOut.Enabled := True;
|
||||
|
||||
{Run splash}
|
||||
Run(Applet);
|
||||
|
||||
{Free the bitmap:it has no parent}
|
||||
Bitmap.free;
|
||||
|
||||
end.
|
Loading…
Add table
Add a link
Reference in a new issue