Jump to content

Animeted GIF with _IECreateEmbedded with background option


Go to solution Solved by Subz,

Recommended Posts

Hi, I want to use animated link on my gui by using _IECreateEmbedded, but my background has white place even if i change the background color..

Is there any way to change or clear off the white color from my gui screen.

nonname.png

#Include <IE.au3>
$sGIF = "https://user-images.githubusercontent.com/14011726/94132137-7d4fc100-fe7c-11ea-8512-69f90cb65e48.gif"
$hGui = GUICreate("Test", 750, 550)
$oIE = _IECreateEmbedded()
GUICtrlCreateObj($oIE, 50, 50, 340, 345)
_IENavigate($oIE, $sGIF)
GUISetState()
;~ $oIE.navigate("about:blank") (I tried with this but i couldnt find a way) 
$oIE.document.body.style.border="0"
$oIE.document.write("<body style='background-color:grey'></body>") ; (I tried with this but i couldnt find a way) 
$oIE.document.write("<body style='border:0;margin:0px'><iframe scrolling=no frameborder=0 src =" & $sGIF & " width=100% height=100%></iframe></body>")

;~ $oIE.style.backgroundColor = 0; (I tried with this but i couldnt find a way) 
$oIE.refresh
$oIE.document.body.scroll = "no"
Do
    Sleep(20)
Until GUIGetMsg() = -3

 

 

Edited by ratakantez
Link to comment
Share on other sites

  • Solution

Why not just use <a> tag + <img> tag for example:

$oIE.document.write('<body style="margin:0;border:none"><a href="https://www.autoitscript.com/" target="_blank"><img width="100%" height="100%" src="' & $sGIF & '" alt="AutoIt" style="border:none"></a></body>')

The issue is that you're trying to display the image within iframe, the iframe is outside the scope of your pages css, if you open the image in a browser you'll notice that it's rendered with margin + border.

Link to comment
Share on other sites

4 hours ago, Subz said:

Why not just use <a> tag + <img> tag for example:

$oIE.document.write('<body style="margin:0;border:none"><a href="https://www.autoitscript.com/" target="_blank"><img width="100%" height="100%" src="' & $sGIF & '" alt="AutoIt" style="border:none"></a></body>')

The issue is that you're trying to display the image within iframe, the iframe is outside the scope of your pages css, if you open the image in a browser you'll notice that it's rendered with margin + border.

yes you are right. probably my queastion was so stupid 😐 because i am realy new at coding.. and i dont know HTML enough. Thanks for your advice. It works perfect

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...