From 3a2b46e2d44e342d5316addc55e069c81c7d79f9 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 4 Sep 2002 12:56:49 +0000 Subject: [PATCH] New UberSplash by Vince git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@901 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/UberSplash/UberSplash.txt | 13 +++ Contrib/UberSplash/splash.cfg | 40 +++++++++ Contrib/UberSplash/splash.dcu | Bin 0 -> 1898 bytes Contrib/UberSplash/splash.dof | 96 +++++++++++++++++++++ Contrib/UberSplash/splash.dpr | 138 ++++++++++++++++++++++++++++++ 5 files changed, 287 insertions(+) create mode 100644 Contrib/UberSplash/UberSplash.txt create mode 100644 Contrib/UberSplash/splash.cfg create mode 100644 Contrib/UberSplash/splash.dcu create mode 100644 Contrib/UberSplash/splash.dof create mode 100644 Contrib/UberSplash/splash.dpr diff --git a/Contrib/UberSplash/UberSplash.txt b/Contrib/UberSplash/UberSplash.txt new file mode 100644 index 00000000..8dce572d --- /dev/null +++ b/Contrib/UberSplash/UberSplash.txt @@ -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 \ No newline at end of file diff --git a/Contrib/UberSplash/splash.cfg b/Contrib/UberSplash/splash.cfg new file mode 100644 index 00000000..1d7cf9f9 --- /dev/null +++ b/Contrib/UberSplash/splash.cfg @@ -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 diff --git a/Contrib/UberSplash/splash.dcu b/Contrib/UberSplash/splash.dcu new file mode 100644 index 0000000000000000000000000000000000000000..953b3963b41d28da543b48a9f3ee7e233c1e6984 GIT binary patch literal 1898 zcma)6Uuaup6#wo?a(kP#x7RGove1>ZXenI{-BQLFbF@vCcGz}t$-1@cy4~dd?QZV9 zySZWO5G-^rB?y~}s1HK%!50;`i4PT|&+-)qxT%E922>C*NVZzW1 z3;l@UUG;Fr=I2l7S;Ooi70q}QchWtFN7m)m+SmzAHYDsi^tlH;Iiu^Fq^URTqrQP9%9p zPmWAHz8!fkc}9~7;^2hLeDS!h+BeQWdoM50II_h83GnM+;G-9}-v7|ZN9iHc)I|HqS@nE3M52sy zqr=7(7if>t_>mju%_sez#rAqTqRp=2ld}Hg>7Ie-{%90p`=uc2@tNdNSYTdXo<@Br z)aesSg~EJ@MV)jJzYwAo0_cQfBGlr|_p~@d)vLU%8u|i}i)K2bp?nYRehe1K`;U0K zlMCgOh(Wh#o5JZ1EZ#@c z`|kfwzIq>J58kazSMQ^|=Fa1eID2+#>f9QZjPJ2R<2B=a`M2ZTfmp6!B2*BNPvNLs z0Q`QR$x>#Rk|LDZ0+XE23Q)6tD%V0uVaj5mB>-#)I2HnZ5DY*l4B-Go0?;0S4wka~ z5M`l@g&se3fuj@_Vj=2+A9``fLMTZ5e#agN!$24gvT&G#BVBNag+UI6yWnUq_*qD@ zkea5g>jwuA^j@N7y+^$ IIn)pQzXkq7+yDRo literal 0 HcmV?d00001 diff --git a/Contrib/UberSplash/splash.dof b/Contrib/UberSplash/splash.dof new file mode 100644 index 00000000..bae2b5f9 --- /dev/null +++ b/Contrib/UberSplash/splash.dof @@ -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 diff --git a/Contrib/UberSplash/splash.dpr b/Contrib/UberSplash/splash.dpr new file mode 100644 index 00000000..fa9a2dca --- /dev/null +++ b/Contrib/UberSplash/splash.dpr @@ -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.