Display images from websites in your own Gui

Post your working scripts, libraries and tools
User avatar
Delta Pythagorean
Posts: 416
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

Display images from websites in your own Gui

29 Jul 2017, 17:09

Ever wanted to show an image from some website that you don't want to have to set up a download and then add the image to the Gui and then when the program is done delete the images?
Well now it's possible!
All it takes is to know the image's Url and size and you're ready to go!

Here's a working example for showing an image in a Gui with the function and how to use it:

Code: [Select all] [Expand] [Download] (Gui Example.ahk)GeSHi © Codebox Plus



Hope you enjoy showing people your pictures with ease!
And thanks to the wonderful person: joedf for showing his usefulness in making this possible. I used part of his Display() function to get it working! Link here

Any questions can be asked here and any comments or addons can be said here, thank you! :D
JasonDavisFL
Posts: 9
Joined: 12 Jan 2018, 13:05
Facebook: JasonDavis83
GitHub: JasonDavisFL

Re: Display images from websites in your own Gui

09 Feb 2018, 10:04

Awesome just what I need for a Bookmark manager app I am building where I am going to have a Tab that shows all images I have attached to the bookmark record and this is a great way to show them images in the GUI
garry
Posts: 1419
Joined: 22 Dec 2013, 12:50

Re: Display images from websites in your own Gui

15 Feb 2018, 13:39

@Delta Pythagorean, thank you
here also an example to show a picture in a GUI , but it downloads

Code: [Select all] [Download] GeSHi © Codebox Plus

F0=http://i.imgur.com/pgCT683.jpg
F1=%a_desktop%\China_Canada_Joke.jpg
SplitPath,f1,,,,nne,
ifnotexist,%f1%
urldownloadtofile,%f0%,%f1%
Gui, Add, Picture, w1100 h-1 ,%f1%
Gui, Show,x1 y1 ,%nne%
return
Guiclose:
exitapp
User avatar
Delta Pythagorean
Posts: 416
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

Re: Display images from websites in your own Gui

15 Feb 2018, 14:52

garry wrote:@Delta Pythagorean, thank you
here also an example to show a picture in a GUI , but it downloads

Code: [Select all] [Download] GeSHi © Codebox Plus

F0=http://i.imgur.com/pgCT683.jpg
F1=%a_desktop%\China_Canada_Joke.jpg
SplitPath,f1,,,,nne,
ifnotexist,%f1%
urldownloadtofile,%f0%,%f1%
Gui, Add, Picture, w1100 h-1 ,%f1%
Gui, Show,x1 y1 ,%nne%
return
Guiclose:
exitapp


You are correct. But the goal of the topic is to display the image without downloading it at all.
While it is true that you can show a normal image in a GUI, you cannot display gifs (Animated images) in the GUI without it being all hacky and having a bunch of spaghetti code.
garry
Posts: 1419
Joined: 22 Dec 2013, 12:50

Re: Display images from websites in your own Gui

15 Feb 2018, 15:26

I tried with ActiveX , plays GIF with mozilla .
Dont' know how to change the variables in ActiveX if once GUI is created , example below change with reload between vlc or mozilla
A drag&drop example with ActiveX ( with vlc / mozilla )
https://autohotkey.com/boards/viewtopic.php?f=6&t=44007

;- variables for ActiveX =
xxa=VideoLAN.VLCPlugin.2 ;- video / music / foto
xxb=Mozilla.Browser ;- for txt / GIF / ahk
;xxb=Shell.Explorer ;- only for PDF

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 27 guests