Sign in to follow this  
Followers 0
Letis

Picture on background from internet?

3 posts in this topic

#1 ·  Posted (edited)

Hi I have a background with external picture

$picture = GUICtrlCreatePic("C\:background.jpg",0,0,210,80)

Is there any way how to give into background the picture from internet?

example: something like this doesnt work why?

$picture = GUICtrlCreatePic("http://www.autoitscript.com/background.jpg",0,0,210,80)

Edited by Letis

Share this post


Link to post
Share on other sites



Hi I have a background with external picture

$picture = GUICtrlCreatePic("C\:background.jpg",0,0,210,80)

Is there any way how to give into background the picture from internet?

example: something like this doesnt work why?

$picture = GUICtrlCreatePic("http://www.autoitscript.com/background.jpg",0,0,210,80)

Use Inetget to download the picture from the internet to the local machine and then use GUICtrlcreatePic with the local path... Check the documentation for more details...

Share this post


Link to post
Share on other sites

Letis

As has sayed the Koshy John use the Inetget function:

$sURL = "http://www.autoitscript.com/images/autoit_6_240x100.jpg"
$sFilePic = @TempDir & "\pic.jpg"

If InetGet($sURL, $sFilePic, 1) = 0 Then Exit MsgBox(16, "Error", "Unable to download a file")

#include <GuiConstantsEx.au3>

$hGUI = GUICreate("Test", 300, 200)

$cPic = GUICtrlCreatePic($sFilePic, 0, 0, 300, 200)
GUICtrlSetState(-1, $GUI_DISABLE)

GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

:)

Share this post


Link to post
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
Sign in to follow this  
Followers 0