[Script] Quick Picto Viewer v5+

Post your working scripts, libraries and tools for AHK v1.1 and older
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

25 Aug 2019, 05:07

Quick update to v3.6.8. This is a bug fixes only release.

I also identified that Freeimage.dll relies on vcomp140.dll for a proper initialisation. Now, this dll is included in the ZIP package.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

28 Aug 2019, 03:03

Another bug fixes only release. v3.6.9.

- better handling of missing image files; it is now possible to save or copy to clipboard the image loaded, even if the initial file is missing
- replaced the inputbox I used for the Jump to Index window with my own GUI, for consistency

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

02 Sep 2019, 15:22

Work continues...

- v3.7.0 (2019-09-02)
- [new] when text is found in the clipboard, on pressing Ctrl+V, it will be rendered as an image [similar to how IrfanView does it]
- [new] interface settings panel; the user can now change colors, fonts and sizes; these options will be reused for rendering clipboard texts as images
- other fixes

I also found bugs related to alpha channel support.... hmm [banging head]....

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

15 Oct 2019, 15:34

Hello, guys!

After expanding/compiling the biggest GDI+ library wrapper for AHK, i resumed improving Quick Picto Viewer . This new version brings histograms, scrollbars, image rotation in the viewport, GIF frames and multi-paged TIFFs support, ... proper alpha-channel support when opening and saving files... relative coordinates for image selections and a lot more. It relies a lot on the new GDI+ library.

Here's the change log:

- v3.8.0 (2019-10-15)
- [new] option to navigate between GIF frames or multi-paged TIFFs using Page Up/Down; by pressing Ctrl+C, the currently visible frame is copied to the clipboard
- [new] option to display luminance histogram for the current image, in real time during color adjustments
- [new] ability to make file selections that are not limited to ranges; files can now be individually selected
- [new] scrollbars to help with panning images larger than the viewport
- [new] gamma and threshold color adjustment options
- [new] option to render opaque semi-transparent pixels in images with an alpha channel
- [new] rotate images in the viewport in steps of 15 degrees with [9] or [0] or at any degree in the image view panel
- [new] ambiental textured window background , automatically generated based on the current image displayied
- [new] alpha channel support for images loaded or saved through the FreeImage library
- [new] option to choose text alignment for texts pasted from the clipboard
- [new] status bar in thumbnails list mode
- [new] file information box in the HUD/OSD; press I to invoke it
- [new] option to have the viewport image selection coordinates in percentages relative to image width and height
- optimizations to the image drawing routines; image down-scailing occurs only if the image is drawn slowly
- improvements and bug fixes related to image viewport selections
- reorganized the image view [color adjustments] panel
- various additional minor improvements

Links:
https://github.com/marius-sucan/Quick-Picto-Viewer
http://marius.sucan.ro/media/files/blog/ahk-scripts/quick-picto-viewer-compiled.zip

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

16 Oct 2019, 01:56

soooo muchhhh.. Thank you
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

16 Oct 2019, 11:07

Hello, guys!

Thank you very much for the messages .

I released an updated version with bug fixes:

- v3.8.1 (2019-10-16)
- added shift + click to create a new selection in the image view
- added ctrl + wheel up/down to zoom in/out
- important bug fixes to resize panel features and batch processing

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

16 Oct 2019, 15:15

Good project. 8-)
I suggest a simple hack to play sound as well. When an image is shown the script tries to play the corresponding sound file (which has the same name but with a different extension e. g. "mp3")
It will be useful for example if you want to create a slide show with an audio commentary for each image or to create flash cards to study a foreign language.
You can make it an option that can be selected "autoplay the corresponding mp3 file" or "autoplay the corresponding wav file" or "play the sound file only when you press the S key"

here is the simple hack

Code: Select all

    } Else 
      {
      ShowTheImage(imgPath)
      soundPath:=RegExReplace(imgPath, "S)\..*?$") ".mp3"
      SoundPlay, % soundPath, wait
      }
    Return 1
}
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

16 Oct 2019, 17:17

A very good idea! Thank you.

Is there a way to interrupt the sound play? I see you used wait. And I see why.... But I'd like the user to be able to interrupt it freely...

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

16 Oct 2019, 17:30

How about something like this?

Code: Select all

!s::
SoundPlay, Intro.wav
return

!d::
SoundSetWaveVolume, 0
return

!u::
SoundSetWaveVolume, 100
return

Escape::ExitApp
User avatar
tidbit
Posts: 1272
Joined: 29 Sep 2013, 17:15
Location: USA

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

16 Oct 2019, 20:57

@burque505
if you EVER touch my volume, especially set it to 100 (I keep mine around 20%. 100% is just bad for everyone), I will personally hunt you down and verbally scold you while shaking my finger viciously and then uninstall your AHK.
unless it's a script specifically for volume control, NEVER touch the volume (same for clipboard).
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
Bugz000
Posts: 93
Joined: 30 Sep 2013, 10:01

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

16 Oct 2019, 21:07

burque505 wrote:
16 Oct 2019, 17:30
How about something like this?

Code: Select all

!s::
SoundPlay, Intro.wav
return

!d::
SoundSetWaveVolume, 0
return

!u::
SoundSetWaveVolume, 100
return

Escape::ExitApp
tidbit wrote:
16 Oct 2019, 20:57
@burque505
if you EVER touch my volume, especially set it to 100 (I keep mine around 20%. 100% is just bad for everyone), I will personally hunt you down and verbally scold you while shaking my finger viciously and then uninstall your AHK.
unless it's a script specifically for volume control, NEVER touch the volume (same for clipboard).
can confirm, i did it once and i still haven't fully recovered from the repercussions :'(
he isn't gentle
Image
||-------[-HP-ML350E-G8-]-------||-[-32-core-xeon-]-||--[-48gb-ECC-]--||
||----[-Dell-Poweredge-r610-]---||-[-16-core-xeon-]-||--[-16gb-ECC-]--||
||-[-Lenovo-ThinkPad-x201-tab-]-||---[-4-core-i7-]--||-[-8gb-nonECC-]-||
||---------------------------[-shack--img-]---------------------------||
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 07:50

:) Sorry, say what? I'm a little hard of hearing.
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 13:26

robodesign wrote:
16 Oct 2019, 17:17
Is there a way to interrupt the sound play? I see you used wait. And I see why.... But I'd like the user to be able to interrupt it freely...
It's risky to use the wait option. Especially if the sound lasts a long time but the wait parameter is useful only for the slide show.
here is a safer script, the wait option is only activated when the slideshow is played.

Code: Select all

SoundPlay, % soundPath, % (slideShowRunning) ? "wait" : null
It is also possible to increase security with more additional variables that you can activate in option.

Code: Select all

; soundPlay and wait are allowed by the user
if (ok_to_play_sound) 
SoundPlay, % soundPath, % (slideShowRunning) && (ok_to_wait) ? "wait" : null
Even if there are some downsides I think adding this feature will give you a clear advantage over other image viewers. 8-)
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 14:56

Yes, i agree with you, @SpeedMaster .

However, imagine the following scenarios A and B:
A. The user navigates between images with wheel up/down or the arrow keys. Some images have sounds associated, some not. If I do not use wait, the sound needs to be cut-off when switching the image. Just use SoundPlay, [inexistent-file] for this ?

B. A slideshow is running, the sound is a minute long explaining the image. If I use wait for soundplay, the user will be forced to listen to it and not be able to stop it. How do I cut it off? If I switch to using AHK-H, I can make a new thread for sound playing and destroy it whenever I want. That is what I did for my other application , Church Bells Tower.

If any ideas, please let me know . Otherwise, I will jump ship to AHK_H for this project as well . ;-)


Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 15:11

How about SoundSet? As tidbit mentioned, keeping the volume at the level already set is probably a must, so maybe SoundGet to grab the existing level and restore it as needed. Also it looks like SoundSet has a "mute" toggle, might that not work?
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 15:16

Does soundset/get apply to the current application ? That is qpv.exe . I would not like to change the master volume.

And , during a slideshow... if I do not use Wait, how long do I know to wait for the audio to end?

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 15:20

Looks like it defaults to Master. Could you use Wait in conjunction with something like this?

Code: Select all

global level := ""

!s::
SoundGet, level
SoundPlay, Intro.wav
return

!d::
SoundSetWaveVolume, 0
return

!u::
SoundSetWaveVolume, %level%
msgbox Level is %level%
return


Escape::ExitApp
At least on my system it restores the master volume OK.

This may get closer:

Code: Select all

global level := ""
global slideShowRunning := true
global ok_to_play_sound := true

global soundPath := "Intro.wav"

!y::
slideShowRunning := true
return

!n::
slideShowRunning := false
return

!s::
SoundGet, level
if (ok_to_play_sound) && (slideShowRunning)
	SoundPlay, % soundPath, % (slideShowRunning) && (ok_to_wait) ? "wait" : null
return

!d::
SoundSetWaveVolume, 0
return

!u::
SoundSetWaveVolume, %level%
msgbox, , , Level is %level%, 1
return

!x::
SoundPlay, DavesNotHere.wav
return

Escape::ExitApp
Obviously the control logic is hinky.
Last edited by burque505 on 17 Oct 2019, 15:31, edited 1 time in total.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 15:31

No.... That does not cut it for me .

The sound must be, at any moment stoppable and the volume changes must apply only on my own process. I do not want it to play a sound file «silently».
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [Script] Quick Picto Viewer and Fast Slideshow creator

17 Oct 2019, 15:32

And it needs to be able to restart also, correct?

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 104 guests