Home > Net >  How to fit any image or site in an activex GUI on autohotkey?
How to fit any image or site in an activex GUI on autohotkey?

Time:06-04

Anyone know, how to fit this image in an activex gui?

    URL = https://img.freepik.com/fotos-gratis/imagem-aproximada-em-tons-de-cinza-de-uma-aguia-careca-americana-em-um-fundo-escuro_181624-31795.jpg?w=2000
    Gui Add, ActiveX, xm w980 h480 vWB, Shell.Explorer
    WB.Navigate(URL)
    Gui, Show, w1000 h500
    return

    Guiclose:
        ExitApp

I know that i can use picture for this, but, i need to use activex for my project. The above code is just an example.

Sorry for my english, it's a work in progress..

CodePudding user response:

I am not super familiar with creating the DOM progmatically, only idea I have is something like navigating to a webpage then:

newHTML =
(
<HTML>
<title>My Webpage</title>
<body>
<img src="(your link here)" width="1000" height="500">
</body>
<html>
)
WB.Document.Body.InnerHTML := newHTML

I have used a similar trick other times with IE so not sure how that would work in this case.

CodePudding user response:

URL = https://img.freepik.com/fotos-gratis/imagem-aproximada-em-tons-de-cinza-de-uma-aguia-careca-americana-em-um-fundo-escuro_181624-31795.jpg?w=2000

Gui Add, ActiveX, xm w980 h480 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
  • Related