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
Gui, -MinimizeBox +Resize +MinSize500x250
Gui, Add, ActiveX, x0 y0 w350 h100 vWB1, Shell.Explorer
; This can be an image from a website, or an image from your computer. Just specify the path based off of the current script directory.
Edit := WebPic(WB1, "https://autohotkey.com/assets/images/ahk-logo-no-text241x78-180.png", "w241 h78 cFFFFFF")
Gui, Add, Edit, x0 y105 w750 h215 -Wrap +HScroll vEdit TabStop WantReturn t8
Gui, Show, w750 h320, Gui Example
GuiControl,, Edit, % Edit
Return
GuiClose:
ExitApp
GuiSize:
GuiControl, MoveDraw, Edit, % "w" A_GuiWidth " h" A_GuiHeight - 105
Return
;||==================================================================================;||
;|| How to use it: ;||
;|| WB ;||
;|| the unquoted variable of the ActiveX Gui variable ;||
;|| Website ;||
;|| Pretty self explainitory ;||
;|| Options ;||
;|| Set the image's width and height. ;||
;|| Works the same way Gui works: ;||
;|| w50 h50 cEEEEEE ;||
;|| These are the default settings. ;||
;|| To change them, ;||
;|| specify the same way how you would change them for a Gui control ;||
;||==================================================================================;||
WebPic(WB, Website, Options := "") {
RegExMatch(Options, "i)w\K\d+", W), (W = "") ? W := 50 :
RegExMatch(Options, "i)h\K\d+", H), (H = "") ? H := 50 :
RegExMatch(Options, "i)c\K\d+", C), (C = "") ? C := "EEEEEE" :
WB.Silent := True
HTML_Page :=
(RTRIM
"<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #" C ";
}
img {
top: 0px;
left: 0px;
}
</style>
</head>
<body>
<img src=""" Website """ alt=""Picture"" style=""width:" W "px;height:" H "px;"" />
</body>
</html>"
)
While (WB.Busy)
Sleep 10
WB.Navigate("about:" HTML_Page)
Return HTML_Page
}
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! Linked here
Any questions can be asked here and any comments or addons can be said here, thank you!