SlideShow
- flyingDman
- Posts: 2823
- Joined: 29 Sep 2013, 19:01
Re: SlideShow
I forgot who the author is of this:
Code: Select all
#SingleInstance Force
Slideshow("C:\Users\xxx\Pictures\Wallpaper\*.jpg", 3)
return
esc::
GuiEscape:
ExitApp
SlideShow(fileList, duration)
{
global
toplefty := 0, topleftx := 0, windh := A_ScreenHeight - 0,
objh := A_ScreenHeight - toplefty, objw := A_ScreenWidth - topleftx
gui, Add, Picture, x%topleftx% y%toplefty% h%objh% w%objw% center vimg,
Gui, Color, Black
Gui -Caption
Gui, Show,x0 y0 w%A_ScreenWidth% h%windh%, picwin
Loop, %filelist%
{
;~ tooltip,%a_LoopFileLongPath%
guicontrol,hide,img
guicontrol,, img, *h%objh% *w-1 %a_LoopFileLongPath%
ControlGetPos,imgx,imgy,imgw,imgh,static1,picwin
if imgw > %objw%
{
guicontrol,, img, *w%objw% *h-1 %a_loopfield%
ControlGetPos,,,,imgh,static1,picwin
imgy := (objh - imgh)//2 + toplefty
guiControl,Move,img,x%topleftx%,y%imgy%
}
else
{
imgx := (objw - imgw)//2 + topleftx
guiControl,Move,img,x%imgx%,y%toplefty%
}
guicontrol,show,img
KeyWait,right,D T%duration%
}
}
14.3 & 1.3.7
Re: SlideShow
Hi,
and thanks for the code, works perfectly!
I do have one problem with it
It's first in the script, it should run through all the pics, then the script should continue.
As it is now, it waits for a keystroke to stop....
SimPlayer
and thanks for the code, works perfectly!
I do have one problem with it
It's first in the script, it should run through all the pics, then the script should continue.
As it is now, it waits for a keystroke to stop....
SimPlayer
- flyingDman
- Posts: 2823
- Joined: 29 Sep 2013, 19:01
Re: SlideShow
If you want it to exit after showing all images in the folder use:
if you want it to restart the show for an indefinite loop use:
Code: Select all
Slideshow("C:\Users\xxxx\Pictures\Wallpaper\*.jpg", 3)
exitapp
Code: Select all
#SingleInstance Force
Loop
Slideshow("C:\Users\xxxx\Pictures\Wallpaper\*.jpg", 3)
return
esc::
GuiEscape:
ExitApp
SlideShow(fileList, duration)
{
global
toplefty := 0, topleftx := 0, windh := A_ScreenHeight - 0,
objh := A_ScreenHeight - toplefty, objw := A_ScreenWidth - topleftx
gui, New :<<<<<<<<<<<
gui, Add, Picture, x%topleftx% y%toplefty% h%objh% w%objw% center vimg,
Gui, Color, Black
Gui -Caption
Gui, Show,x0 y0 w%A_ScreenWidth% h%windh%, picwin
Loop, %filelist%
{
; tooltip,%a_LoopFileLongPath%
guicontrol,hide,img
guicontrol,, img, *h%objh% *w-1 %a_LoopFileLongPath%
ControlGetPos,imgx,imgy,imgw,imgh,static1,picwin
if (imgw > objw)
{
guicontrol,, img, *w%objw% *h-1 %a_loopfield%
ControlGetPos,,,,imgh,static1,picwin
imgy := (objh - imgh)//2 + toplefty
guiControl,Move,img,x%topleftx%,y%imgy%
}
else
{
imgx := (objw - imgw)//2 + topleftx
guiControl,Move,img,x%imgx%,y%toplefty%
}
guicontrol,show,img
KeyWait,right,D T%duration%
}
}
14.3 & 1.3.7
Re: SlideShow
Hi again.
As I told you the code should be first in the script, it should run through all the pics, then the script should continue, not exit at that point.
For some reason, the script doesn´t read the rest of the code in the script, and all goes wrong.
SimPlayer
As I told you the code should be first in the script, it should run through all the pics, then the script should continue, not exit at that point.
For some reason, the script doesn´t read the rest of the code in the script, and all goes wrong.
SimPlayer
- flyingDman
- Posts: 2823
- Joined: 29 Sep 2013, 19:01
Re: SlideShow
It's not that the code should be "first in the script" it is that you have other lines of code (which you did not tell about). What you need is probably just a gui, destroy at the end of the function, like so:
Code: Select all
Slideshow("C:\Users\xxxx\Pictures\Wallpaper\*.jpg", 1)
msgbox rest of script
return
esc::
GuiEscape:
ExitApp
SlideShow(fileList, duration)
{
global
toplefty := 0, topleftx := 0, windh := A_ScreenHeight - 0,
objh := A_ScreenHeight - toplefty, objw := A_ScreenWidth - topleftx
gui, New
gui, Add, Picture, x%topleftx% y%toplefty% h%objh% w%objw% center vimg,
Gui, Color, Black
Gui -Caption
Gui, Show,x0 y0 w%A_ScreenWidth% h%windh%, picwin
Loop, %filelist%
{
;tooltip,%a_LoopFileLongPath%
guicontrol,hide,img
guicontrol,, img, *h%objh% *w-1 %a_LoopFileLongPath%
ControlGetPos,imgx,imgy,imgw,imgh,static1,picwin
if (imgw > objw)
{
guicontrol,, img, *w%objw% *h-1 %a_loopfield%
ControlGetPos,,,,imgh,static1,picwin
imgy := (objh - imgh)//2 + toplefty
guiControl,Move,img,x%topleftx%,y%imgy%
}
else
{
imgx := (objw - imgw)//2 + topleftx
guiControl,Move,img,x%imgx%,y%toplefty%
}
guicontrol,show,img
KeyWait,right,D T%duration%
}
Gui, Destroy ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}
14.3 & 1.3.7
Re: SlideShow
Hi again.
Yess, now it works as it should, thanks man!
But, the indefinate loop I can´t get to work, I get an error, see the attached file.
This first thing that works ok,was an InfoSlideshow to be viewed automatically one time, but this second slideshow is more like a screensaver, it should run indefinately until it´s aborted by a keystroke.
SimPlayer
Yess, now it works as it should, thanks man!
But, the indefinate loop I can´t get to work, I get an error, see the attached file.
This first thing that works ok,was an InfoSlideshow to be viewed automatically one time, but this second slideshow is more like a screensaver, it should run indefinately until it´s aborted by a keystroke.
SimPlayer
- Attachments
-
- Error.JPG (17.33 KiB) Viewed 684 times
Re: SlideShow
Hi
With a little bit of trying, I got it!
SP
[Mod edit: [code][/code] tags added.]
With a little bit of trying, I got it!
SP
Code: Select all
#SingleInstance Force
Loop
Slideshow("C:\LFS\Info\*.jpg", 3)
return
esc::
GuiEscape:
ExitApp
SlideShow(fileList, duration)
{
global
toplefty := 0, topleftx := 0, windh := A_ScreenHeight - 0,
objh := A_ScreenHeight - toplefty, objw := A_ScreenWidth - topleftx
gui, New
gui, Add, Picture, x%topleftx% y%toplefty% h%objh% w%objw% center vimg,
Gui, Color, Black
Gui -Caption
Gui, Show,x0 y0 w%A_ScreenWidth% h%windh%, picwin
Loop, %filelist%
{
;tooltip,%a_LoopFileLongPath%
guicontrol,hide,img
guicontrol,, img, *h%objh% *w-1 %a_LoopFileLongPath%
ControlGetPos,imgx,imgy,imgw,imgh,static1,picwin
if (imgw > objw)
{
guicontrol,, img, *w%objw% *h-1 %a_loopfield%
ControlGetPos,,,,imgh,static1,picwin
imgy := (objh - imgh)//2 + toplefty
guiControl,Move,img,x%topleftx%,y%imgy%
}
else
{
imgx := (objw - imgw)//2 + topleftx
guiControl,Move,img,x%imgx%,y%toplefty%
}
guicontrol,show,img
KeyWait,right,D T%duration%
}
}
Last edited by gregster on 15 Apr 2022, 12:03, edited 1 time in total.
Reason: Please use code tags. Thank you!
Reason: Please use code tags. Thank you!
-
- Posts: 2
- Joined: 12 Sep 2018, 19:19
Re: SlideShow
Hi there, awesome Script!
How can you have resize image of slideshows to be A_screenwidth/2, and A_heigth/2, like --> https://drive.google.com/file/d/14B1tDJBJ32KJ_a9Qiq583lujz5k9dYja/view?usp=sharing (or see pic attachment)
(ignore the colors of the box its just for demonstration of where the images would be placed)
and if you could set images a bit transparent to be able to see the background would be awesome
Thanks a lot, best regards,
How can you have resize image of slideshows to be A_screenwidth/2, and A_heigth/2, like --> https://drive.google.com/file/d/14B1tDJBJ32KJ_a9Qiq583lujz5k9dYja/view?usp=sharing (or see pic attachment)
(ignore the colors of the box its just for demonstration of where the images would be placed)
and if you could set images a bit transparent to be able to see the background would be awesome
Thanks a lot, best regards,
- Attachments
-
- chrome_eP5y1UZCUW.png (262.63 KiB) Viewed 514 times