Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Crazy Scripting : Photo SlideShow created with AutoHotkey


  • Please log in to reply
34 replies to this topic
SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Posted Image
Posted Image
The above is a FullScreen Snapshot taken with the screen resolution set @ 640x480x16m

[*:2vxprq7v]The SlideShow.exe runs Fullscreen with Slides sized @ 80% of the Desktop area.
The background is filled with a 3x3 Bitmap Gradient.

[*:2vxprq7v]The SlideShow.exe is sized @ a whopping 5.31 MB as it contains 94 JPEG Images totalling to 5.17 MB.
The list of files that will be unpacked (FileInstall) to your TEMP folder (on the first run) is here.
It takes considerable seconds to unpack all those files.

[*:2vxprq7v]SlideShow.exe takes a few seconds to load everytime it is run and will be displaying the following message centered on the screen:

Posted Image[/list]
The delay is caused by Eminem-Mocking_Bird.mid which takes a few seconds to load into the memory.

[*:2vxprq7v]SlideShow.exe will not run properly without a SoundCard.

[*:2vxprq7v]SlideShow.exe does not display a TrayIcon and the user can press the key once to terminate it.
If there is an image transition on, the thread is not interuppted immediately and SlideShow.exe will be terminated as soon as the transition is complete. So, press the key just once - and wait for the program to terminate.

[*:2vxprq7v]The concept for this project has been adapted from the Shareware software: Slide Show To Go - 7

[*:2vxprq7v]Visit TipsNTricks: How to Animate a GUI ? which elaborates the technique used.

[*:2vxprq7v]Download SlideShow.exe [5.31 MB].

Edit: 04-Jul-2006

[*:2vxprq7v] To Unpack the Source Code & all files run SlideShow.exe /ExtractSource
[/list]Can someone check out SlideShow.exe for me in Windows 98 SE ? Please!

Regards , :)


kWo4Lk1.png

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
... and I thought someone would request for the source.

Anyways!

The following will unpack all the files - including source to a sub-folder named Source:

Run, SlideShow.exe /ExtractSource

The executable was not password encrypted so EXE2AHK would also work, but using /ExtractSource will make things more understandable and easier to adapt.

Again: Someone, please let me know if it works with Windows 98.

Regards, :)
kWo4Lk1.png

IconBoy
  • Validating
  • 108 posts
  • Last active: Sep 04 2019 06:39 PM
  • Joined: 24 Feb 2006
How can I make my own list of photos?
I have about 250 from a wedding that I would like to use. I have already made greyscale images of them and they correspond to the names of the colour photos.
I really don't want to spend an hour copying/pasting text in the ImageList.txt file.
Is there an easier way to add to this list through dialog boxes?
E.g. It can ask:

[*:38acxl9d]How many photos do you have? 250
[*:38acxl9d]What is the prefix name of the photos? wedding
[*:38acxl9d]What special effects do you want to apply to the photos?
Random, all the same? RandomThe result would then produce a text file:
wedding001a.JPG; 1000; 1000; ROLL_LEFT_TO_RIGHT
wedding001b.JPG; 2000; 4200; FADE_IN
wedding002a.JPG; 1000; 2000; ROLL_RIGHT_TO_LEFT
wedding002b.JPG; 2000; 4200; FADE_IN
wedding003a.JPG; 1000; 2000; ROLL_TOP_TO_BOTTOM
wedding003b.JPG; 2000; 4200; FADE_IN
...
wedding248a.JPG; 1000; 2000; ROLL_DIAG_TR_TO_BL
wedding248b.JPG; 2000; 4200; FADE_IN
wedding249a.JPG; 1000; 2000; ROLL_DIAG_BL_TO_TR
wedding249b.JPG; 2000; 4200; FADE_IN
wedding250a.JPG; 1000; 2000; ROLL_DIAG_BR_TO_TL
wedding250b.JPG; 2000; 4200; FADE_IN

Is my only way to cut and paste?
Hope you can help.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Dear IconBoy, :)

How can I make my own list of photos?
I have about 250 from a wedding that I would like to use. I have already made greyscale images of them and they correspond to the names of the colour photos.
I really don't want to spend an hour copying/pasting text in the ImageList.txt file.
Is there an easier way to add to this list through dialog boxes?


:shock: 500 Photos ?!!

I am afraid that the loop I have used in SlideShow.exe will hit the maximum number of 99.
This is a limitation of the Gui Command. However, since we can destroy and recreate GUI's, I will
have to work on a different loop structure! Please allow sometime I will post a better version.

Simply put, right now the loop will handle only 49 Color Photos + 49 B&W Photos. Be warned that,
even If it is possible to FileInstall 500 Photos @ 640x480, The final executable size may be sized around 25 MB !!!

This being informed, let me share with you some code that I used to automate the process when I was working
in the project. I put a list of effects in file named Effect.txt and processed it from CreateImageList.ahk
to create ImageList.txt.

Here are the contents of Effect.txt:

ROLL_LEFT_TO_RIGHT
ROLL_RIGHT_TO_LEFT
ROLL_TOP_TO_BOTTOM
ROLL_BOTTOM_TO_TOP
ROLL_DIAG_TL_TO_BR
ROLL_DIAG_TR_TO_BL
ROLL_DIAG_BL_TO_TR
ROLL_DIAG_BR_TO_TL
SLIDE_LEFT_TO_RIGHT
SLIDE_RIGHT_TO_LEFT
SLIDE_TOP_TO_BOTTOM
SLIDE_BOTTOM_TO_TOP
SLIDE_DIAG_TL_TO_BR
SLIDE_DIAG_TR_TO_BL
SLIDE_DIAG_BL_TO_TR
SLIDE_DIAG_BR_TO_TL
ZOOM_IN

Here are the contents of CreateImageList.ahk:

FileDelete, ImageList.txt
OddTrans =1000
OddDurn  =2000
EvenTrans=2000
EvenDurn =4000

Once=1
Loop, *.jpg {
  If Once {
     Files:=A_LoopFileName
     Once=0
   }
  else
     Files:=Files . "`n" . A_LoopFileName
 }

Sort, Files
Snum=1
ODD=1

Loop, Parse, Files, `n 
{
  Part1:=A_LoopField
  IF ODD
     {
       FileReadLine, Part2, Effect.txt, %Snum%
       If Errorlevel <> 0 
          {
           FileReadLine, Part2, Effect.txt, 1
           Snum=1
          }
       else
           SNum+=1

       FileAppend, %Part1%`; %OddTrans%`; %OddDurn%`; %Part2% `n,   ImageList.txt
       ODD=0
    }
   else 
    {
       part2:="FADE_IN"
       FileAppend, %Part1%`; %EvenTrans%`; %EvenDurn%`; %Part2% `n, ImageList.txt
       ODD=1
    }
}
Return

Put both the files into the Images Folder and run CreateImageList.ahk to create ImageList.txt.
If you do not want a particular effect remove it from effect.txt. You may alter the order of effect.txt to suit your needs.

The following code (CodeCreate.ahk) will auto-generate code for File-Installing the images.

;CodeCreate.ahk

FileDelete, Code.txt

Loop, 48
{
Filea= % "Slide" NumStr(A_Index,2,0,"0") "a.jpg"
Fileb= % "Slide" NumStr(A_Index,2,0,"0") "b.jpg"

FileAppend, IfNotExist`, `%Target`%\%Filea% `n, code.txt
FileAppend, %A_Space%FileInstall`, Images\%Filea%`, `%Target`%\%Filea% `n, code.txt
FileAppend, IfNotExist`, `%Target`%\%Fileb% `n, code.txt
FileAppend, %A_Space%FileInstall`, Images\%Fileb%`, `%Target`%\%Fileb% `n`n, code.txt
}

Run code.txt
Return

NumStr(Value,Width,Dec,PadB4="") 
{ 
SetFormat, float, .%Dec% 
Value+=0 
      Loop, 
        { 
          if (StrLen(Value) < Width AND PadB4!="") 
             Value = % PadB4 Value 
          else 
             break 
         } 
Return Value 
}

You will have change "Slide" into "Wedding" and Loop, 48 as required,
Run this file and Copy / Paste the result into InstallImages() in SlideShow.ahk

I always wanted to create a SlideShow in AHK and when I discovered AnimateWindow function,
I was very happy and created this SlideShow in haste, to demonstrate the power of said function.

Creating a Front-end GUI for this might not be very difficult ... but not with lacklustre interest shown by the community.

Please allow me sometime.
I will post a reconstructed SlideShow.exe that will not suffer from the GUI upperlimit of 99 windows.

Regards, :)
kWo4Lk1.png

  • Guests
  • Last active:
  • Joined: --
Thanks. I will see if I can just do 48 for now but will try your automated procedure.
What is nice if you can get the limit above 48, is it could be put on a CD for granparents, neighbour etc.
It is simple yet effective SlideShow.
Thanks very much.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Thanks. I will see if I can just do 48 for now but will try your automated procedure.
What is nice if you can get the limit above 48, is it could be put on a CD for granparents, neighbour etc.
It is simple yet effective SlideShow.
Thanks very much.


The altered script is here: SlideShow.ahk / Preview code as Text. ( It was not as hard as I thought it would be!. :shock: )
Download SlideShow.ahk and replace it with the original. The loop should support any number of images now.
I have not tested it compiled. Please test this and give me feedback so that I can update SlideShow.exe.

Since your wedding photos uses 3 digit numbering, alter lines in CodeCreate.ahk as follows:

Filea= % "Wedding" NumStr(A_Index,3,0,"0") "a.jpg" 
Fileb= % "Wedding" NumStr(A_Index,3,0,"0") "b.jpg"

BugFix: I blundered by forgetting to close the open midifile, which has now been rectified.

Regards, :)
kWo4Lk1.png

willyfoo
  • Members
  • 40 posts
  • Last active: Jul 31 2015 07:35 PM
  • Joined: 03 Jun 2007
Any modifications on this to do a slideshow of a folder??
Ie.. just supply a folder name and it will do a slideshow of the folder..

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
er.. IrfanView does that, though I am not sure whether it does the transitional effects. May be I could give it a try later, but right now I am stuck with a major project.

Thanks. :)

willyfoo
  • Members
  • 40 posts
  • Last active: Jul 31 2015 07:35 PM
  • Joined: 03 Jun 2007
Yes.. Irfanview does that.. though I need to add more functionalities to it and that's why I need to code it... ie.
I need it to start with a particular file, and then move on randomly/sequentially to other photos in the folder after x seconds.

Dra_Gon
  • Members
  • 373 posts
  • Last active: Oct 27 2009 04:20 PM
  • Joined: 25 May 2007
I'm curious about that limit on the number of photos. I haven't tried monkeying with your script yet {I'll get to it soon :wink: } but what if you used "layers" {I don't know how it should be called but that word fits, I think}?
Perhaps something like:
PhotoLayer1:
<<put 1st photoset here>>
Return

PhotoLayer2:
<<put 2nd photoset here>>
Return

PhotoLayer3:
<<put 3rd photoset here>>
Return

etc...
Then a gosub for each one and releasing the previous set of 49.

Also, in your code, you have:
IfNotExist, %Target%\Slide01a.jpg 
 FileInstall, Images\Slide01a.jpg, %Target%\Slide01a.jpg 
IfNotExist, %Target%\Slide01b.jpg 
 FileInstall, Images\Slide01b.jpg, %Target%\Slide01b.jpg 

IfNotExist, %Target%\Slide02a.jpg 
 FileInstall, Images\Slide02a.jpg, %Target%\Slide02a.jpg 
IfNotExist, %Target%\Slide02b.jpg 
 FileInstall, Images\Slide02b.jpg, %Target%\Slide02b.jpg 

IfNotExist, %Target%\Slide03a.jpg 
 FileInstall, Images\Slide03a.jpg, %Target%\Slide03a.jpg 
IfNotExist, %Target%\Slide03b.jpg 
 FileInstall, Images\Slide03b.jpg, %Target%\Slide03b.jpg 

etc...

Is there a reason why a "loop" won't work for this?
loop, 49
   {
       IfNotExist, %Target%\Slide%a_index%a.jpg 
            FileInstall, Images\Slide%a_index%a.jpg, %Target%\Slide%a_index%a.jpg 
       IfNotExist, %Target%\Slide%a_index%b.jpg 
            FileInstall, Images\Slide%a_index%b.jpg, %Target%\Slide%a_index%b.jpg 
    }
I mean, aside from the "0" {Slide01a.jpg}, which can be removed from the file name or added in the context of the code.
This is an interesting script {and I do like messing around with 'em to see what I can do} so I'll be checking it out as I can, but that limit piqued my curiosity a tad bit.

Dra'Gon
Posted Image
For a good laugh {hopefully} >> megamatts.50megs.com

My WritersCafe profile>>
http://www.writersca...BlueDragonFire/

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

I'm curious about that limit on the number of photos. I haven't tried monkeying with your script yet {I'll get to it soon } but what if you used "layers" {I don't know how it should be called but that word fits, I think}?


The altered script is here: SlideShow.ahk / Preview code as Text. ( It was not as hard as I thought it would be!. :shock: )
Download SlideShow.ahk and replace it with the original. The loop should support any number of images now.
I have not tested it compiled. Please test this and give me feedback so that I can update SlideShow.exe.


Is there a reason why a "loop" won't work for this?


FileInstall - Help, says
"The file name must not contain double quotes, variable references (e.g. %A_ProgramFiles%), or wildcards."

Thanks for testing. :)

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Is the picture of the girl included :?: :D
Posted Image

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Is the picture of the girl included :?: :D


Yes! That is "Laetitia Casta" and the first slide of the show.
.. and except for that, the show is themed on nature.

:)

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Yeeey... downloading... :D
Posted Image

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Yeeey... downloading... :D


Just in case you escape'd before the app loaded.
Did you try it? Much to my surprise it takes longer time to load in XP but was quicker in 98/2K.

:)