ActiveX Shell.Explorer control and animated images

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
RazorHalo
Posts: 45
Joined: 21 Dec 2015, 21:23

ActiveX Shell.Explorer control and animated images

23 Aug 2023, 23:58

I have tried using animated images in my GUI's. I would like to use animated PNG or WEBP files instead of GIF's
Using the code below the animated GIF plays fine, but animated PNG or WEBP only displays the first frame.

Code: Select all

URL = [PATH TO IMAGE]\731_128.gif

Gui Add, ActiveX, xm w128 h128 vWB, Shell.Explorer
wb.navigate("about:<meta charset='utf-8'><meta http-equiv='X-UA-Compatible' content='IE=Edge'>")
while (wb.readyState != 4 || wb.busy)
    Sleep -1
wb.document.body.innerHTML := "<style> * { border: 0; margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; } </style><img src='" url "'>"
Gui Show
I know that IE and Chrome can play the animations, if I just drag the file into one of those windows it plays the file just fine.
If I take that same IE or Chrome window and set its parent to my AHK GUI it will embed the browser tab in the AHK GUI and the image still plays just fine - but then I have the whole browser in there and I really only want the animated image.

I guess I'm not sure why its different by loading it as an ActiveX control - I would think it would use the same method to render the image as it does by dragging the file into an open IE/Edge window does - but it doesn't seem to.

I was wondering if anyone could explain why its different or know how it may work? Attached some sample images i used for testing.
Attachments
731_128.png
731_128.png (5.29 KiB) Viewed 334 times
731_128.gif
731_128.gif (18.05 KiB) Viewed 334 times
User avatar
Hellbent
Posts: 2112
Joined: 23 Sep 2017, 13:34

Re: ActiveX Shell.Explorer control and animated images

24 Aug 2023, 14:36

I know that IE and Chrome can play the animations, if I just drag the file into one of those windows it plays the file just fine.
If I take that same IE or Chrome window and set its parent to my AHK GUI it will embed the browser tab in the AHK GUI and the image still plays just fine - but then I have the whole browser in there and I really only want the animated image.
If you can't find an activeX solution you can use a window inside a window inside a window to only show the portion of the browser that you want.

Here is a script that uses nested windows.

viewtopic.php?f=6&t=103165

.
Image
.

And here is where you can find a better explanation of how it works.

viewtopic.php?f=6&t=103165&start=20#p528974

.
Image
.
User avatar
RazorHalo
Posts: 45
Joined: 21 Dec 2015, 21:23

Re: ActiveX Shell.Explorer control and animated images

13 Dec 2023, 01:46

Thanks HellBent, thats some pretty cool stuff.

After more searching I found that the IE ActiveX does not support animated PNG or WEBP files.
I ended up writing a class to handle animated PNG (APNG) files completely though AutoHotkey.
It can be found here viewtopic.php?f=6&t=123979

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 123 guests