Jump to content

Splash Image Question


Recommended Posts

Is there anyway to make splashimage smooth

I.E. you want to scroll through several images as splash images, as it updates the first image dissapears then the second image displays a second later.

Can this be made any smoother, I dont mind the graphic just changing but I dont want to see it dissapear then re-appear.

Thanks

Link to comment
Share on other sites

maybe you should just build up a gui

#include <guiconstants.au3>
dim $picture[11]
$picture[1] = "first pic"
$picture[2] = "second pic"
...
$picture[10] = "10th pic"
guicreate ("", @desktopwidth, @desktopheigth + 20)
$pic = guictrlcreatepic ($picture[random(1,10,1)], 0, 0, @desktopwidth, @desktopheigth + 20)
guisetstate()
$str = timerinit()
while 1
if $timerdiff($str) > 2000 then 
guictrlsetimage($pic, $picture[random(1,10,1)])
$str = timerinit()
endif
wend

how bout this - it's a nice screensaver as well :)

Link to comment
Share on other sites

there's no easy way to do what you want

Global $destination[3], $x
$destination[0] = @Systemdir & "\oobe\images\mslogo.jpg"
$destination[1] = @SystemDir & "\oobe\images\prodkey.gif"
$destination[2] = @SystemDir & "\oobe\images\oemlogo.gif"

For $x = 0 to 2
    SplashImageOn("Splash Screen", $destination[$x],250,50,-300,-60)
    $hwnd = WinGetHandle("Splash Screen")
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 250, "long", 0x00090000);fade-out
    Sleep ( 50 )
    WinMove("Splash Screen","",(@DesktopWidth/2) - 125, (@DesktopHeight/2) - 25)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 4000, "long", 0x00080000);fade-in
    Sleep ( 5000 )
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 4000, "long", 0x00090000);fade-out
Next

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

there's no easy way to do what you want

Global $destination[3], $x
$destination[0] = @Systemdir & "\oobe\images\mslogo.jpg"
$destination[1] = @SystemDir & "\oobe\images\prodkey.gif"
$destination[2] = @SystemDir & "\oobe\images\oemlogo.gif"

For $x = 0 to 2
    SplashImageOn("Splash Screen", $destination[$x],250,50,-300,-60)
    $hwnd = WinGetHandle("Splash Screen")
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 250, "long", 0x00090000);fade-out
    Sleep ( 50 )
    WinMove("Splash Screen","",(@DesktopWidth/2) - 125, (@DesktopHeight/2) - 25)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 4000, "long", 0x00080000);fade-in
    Sleep ( 5000 )
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 4000, "long", 0x00090000);fade-out
Next
Very nice....

I'm not sure I can fit that in with what I am trying to do.. It's a Directory copy with progress but using the adlib to change an image behind it, I tried Nuffilein805 idea but it is very very flickery during the image change, so at the minute it just has a blank gui behind it, which is better but still not quite right.

Any ideas?

#include <GUIConstants.au3>

Global $Run1 = 0, $tosearch, $OverallQty, $Overall, $source, $overallpercent, $Progress0Text, $progressbar1, $Progress1Text, $progressbar2, $Progress2Text, $Gui, $splash, $SPSearch 

AdlibEnable("Adlib", 5000)

$SPSearch = FileFindFirstFile(@ScriptDir & "\Splash\*.jpg")

$graph = GuiCreate ("Splash", @Desktopwidth, @Desktopheight+14, -1, -1 )

GuiSetState()

        



DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)

ProgressCopy(@scriptdir & "\KioskSetup", "d:\")
GuiDelete ($graph)
SplashOff ( )

Run ("D:\Kiosk\setup.bat", "D:\Kiosk")

Func ProgressCopy($current, $destination)
;FirstTimeRun Get original DirSize and set up Gui
    If $Run1 = 0 Then
        If not FileExists ($Destination) then DirCreate ($Destination); This is why it was failing, the dir did not exist
        $source = $current
        If StringRight($current, 1) = '\' Then $current = StringTrimRight($current, 1)
        If StringRight($destination, 1) <> '\' Then $destination = $destination & "\"
        $tosearch = $current
        $Overall = DirGetSize($tosearch, 1)
        $OverallQty = $Overall[1]
        $Gui = GUICreate("Copying Files", 420, 100, -1, -1, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
        $Progress0Text = GUICtrlCreateLabel("Please Wait", 10, 5, 400, 20, $SS_LEFTNOWORDWRAP)
        $progressbar1 = GUICtrlCreateProgress(10, 20, 400, 20)
        GUICtrlSetColor(-1, 32250)
        $Progress1Text = GUICtrlCreateLabel("", 10, 44, 400, 20, $SS_LEFTNOWORDWRAP)
        $progressbar2 = GUICtrlCreateProgress(10, 60, 400, 20, $PBS_SMOOTH)
        $Progress2Text = GUICtrlCreateLabel("", 10, 82, 400, 20, $SS_LEFTNOWORDWRAP)
        GUISetFont(10, 600)
        $Progress2Text2 = GUICtrlCreateLabel("", 150, 62, 400, 20)
        GUICtrlSetColor(-1, 0xffffff); not working with Windows XP Style if not using windows classic style
        GUISetState(@SW_SHOW)
        GUICtrlSetData($Progress1Text, "Working Directory " & $tosearch)
        GUICtrlSetColor($Progressbar1, "0x00AB39")
        GUICtrlSetColor($Progressbar2, "0x00AB39")
        $Run1 = 1
    EndIf
    
    $Size = DirGetSize($current, 3)
    $Qty = $Size[1]
    Local $search = FileFindFirstFile($current & "\*.*")
    While 1
        Dim $file = FileFindNextFile($search)
        If @error Or StringLen($file) < 1 Then ExitLoop
        If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
            $Qty -= 1
            $LocalPercent = 100 - (($Qty / $Size[1]) * 100)
            $OverallQty -= 1
            $overallpercent = 100 - (($OverallQty / $Overall[1]) * 100)
            GUICtrlSetData($Progress0Text, "Total Progress " & Int($overallpercent) & "% completed")
            GUICtrlSetData($progressbar1, $overallpercent)
            GUICtrlSetData($progressbar2, $LocalPercent)
            GUICtrlSetData($Progress2Text, "Copying File " & $file)
            FileCopy($current & "\" & $file, $destination & StringTrimLeft($current, StringLen($source)) & "\" & $file,1)
            FileSetAttrib($destination & StringTrimLeft($current, StringLen($source)) & "\" & $file, "-R")
        EndIf
        If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
            DirCreate($destination & StringTrimLeft($current, StringLen($source)) & "\" & $file)
            FileSetAttrib($destination & StringTrimLeft($current, StringLen($source)) & "\" & $file, "-R")
            GUICtrlSetData($Progress1Text, $current & "\" & $file)
            ProgressCopy($current & "\" & $file, $destination)
        EndIf
    WEnd
    FileClose($search)
;when overall percent = 100 set end gui text, delete gui and reset run1 to 0
    If $overallpercent = 100 Then
        GUICtrlSetData($Progress0Text, "Total Progress 100% completed")
        GUICtrlSetData($progressbar1, 100)
        GUICtrlSetData($progressbar2, 100)
        GUICtrlSetData($Progress2Text, "Done!")
        Sleep(2000)
        GUIDelete($Gui)
        $Run1 = 0
    EndIf
EndFunc ;==>ProgressCopy

Func Adlib()
    
        $splash = FileFindNextFile($SPsearch)
        If @error then 
            $SPsearch = FileFindFirstFile(@scriptdir & "\Splash\*.jpg")
            Return
        Endif
            Splashimageon ("Update",@scriptdir & "\splash\" & $splash, @DesktopWidth , @Desktopheight , -1 , -1 , 3)
EndFunc
Edited by ChrisL
Link to comment
Share on other sites

#include <GuiConstants.au3>

HotKeySet("{Esc}", "_Terminate")
Global $destination[3], $x
$destination[0] = @SystemDir & "\oobe\images\mslogo.jpg"
$destination[1] = @SystemDir & "\oobe\images\prodkey.gif"
$destination[2] = @SystemDir & "\oobe\images\oemlogo.gif"

$Gui = GUICreate("Main Gui", 250, 50, -1, -1, $WS_POPUP)
GUISetState()
$child = GUICreate("Splash Screen", 250, 50, -1, -1, BitOR($WS_POPUP, $WS_CHILD), $WS_EX_TOPMOST, $Gui)
$pic = GUICtrlCreatePic($destination[0], 0, 0, 250, 50)
GUISetState(@SW_SHOW, $child)
AdlibEnable("_FadeImage")
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Func _Terminate()
    Exit
EndFunc  ;==>_Terminate

Func _FadeImage()
    AdlibDisable()
    For $z = 255 To 0 Step - 1
        WinSetTrans("Splash Screen", "", $z)
        Sleep(10)
    Next
    For $y = 1 To 2
        GUICtrlDelete($pic)
        $pic = GUICtrlCreatePic($destination[$y], 0, 0, 250, 50)
        For $x = 0 To 255
            WinSetTrans("Splash Screen", "", $x)
            Sleep(10)
        Next
        For $z = 255 To 0 Step - 1
            WinSetTrans("Splash Screen", "", $z)
            Sleep(10)
        Next
    Next
    GUICtrlDelete($pic)
    $pic = GUICtrlCreatePic($destination[0], 0, 0, 250, 50)
    For $x = 0 To 255
        WinSetTrans("Splash Screen", "", $x)
        Sleep(10)
    Next
    AdlibEnable("_FadeImage")
EndFunc  ;==>_FadeImage

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • 1 year later...

I have been digging around with this script but did get it working. What do I want?

I want it not to fade out but just fade in the new image. So old image should stay on background until new image totally has faded in.. So somekind of overlay with 2 images is that possible?

Thanks

HJW

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...