Image Viewer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
roysubs
Posts: 426
Joined: 29 Sep 2018, 16:37

Image Viewer

19 Nov 2018, 04:16

Found this image viewer code, and it works, but honestly, I don't understand *why* it works. I see the path%num% = stuff (I guess to make path1, path2, path3 etc variables), but then I don't understand what %x1% means in the Gui, Add, Picture bit. I see the %x1% referenced nowhere else(!). Also, what is "vBleah" in the Gui line? Googled on that, found nothing.

But it works.

However, I'd like to alter it a little so that it:
a) resizes the image to be 75% bigger,
b) resizes the window to fit the image so that I can display the images that I need cleanly
c) allows using Left/Right cursor keys to move back/forward through the images and Up/Down cursor keys to zoom in/out.

I think that tons of work must have been done on image viewers (I found a few that were way way overcomplex for my needs), so must be a lot of experts at this on here. If any advice on update this a bit would be great. I like the simplicity of this approach, just want a few tweaks to get it perfect for my needs.

https://autohotkey.com/board/topic/22734-image-viewer/

#noenv ; https://autohotkey.com/board/topic/22734-image-viewer/

num = 1
loop,*.jpg,,1
{
path%num% = %A_LoopFileFullPath%
num++
}
loop,*.bmp,,1
{
path%num% = %A_LoopFileFullPath%
num++
}
loop,*.tif,,1
{
path%num% = %A_LoopFileFullPath%
num++
}
loop,*.png,,1
{
path%num% = %A_LoopFileFullPath%
num++
}
Gui, Add, Picture,vBleah x6 y10 w1160 h690 , %x1%
Gui, Add, Button, x496 y710 w30 h30 g<, <
Gui, Add, Button, x566 y710 w30 h30 g>, >
; Generated using SmartGUI Creator 4.0
Gui, Show, x131 y91 h744 w1180, ImageView
Return

count = 1

>:
location := % path%count%
Guicontrol,,Bleah,*w0 *h0 %location%
if count = %num%
{
count = 1
}
else
{
count++
}
return

<:
count--
location := % path%count%
Guicontrol,,Bleah,*w0 *h0 %location%
if count = 1
{
count = %num%
}
return

GuiClose:
ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Rohwedder, ulysim and 371 guests