John117 Posted December 27, 2007 Share Posted December 27, 2007 (edited) hey I need to add a picture to my gui. It is hosted by a website. -sorry I can't download it because the pic changes and I always need the most recient version on the fly. for this example I'm just gonna use my autoit it pic. If you can help, please do! Thanks! #include <GUIConstants.au3> $GUI = GUICreate("", 1024, 600, Default, Default, $WS_POPUPWINDOW) $GUI_Pic_Map = GUICtrlCreatePic('http://www.autoitscript.com/forum/uploads/profile/photo-24404.jpg', 0, 0, 600, 600) GUISetState(@SW_SHOW, $GUI);Show GUI $GUI_Button_Exit = GUICtrlCreateButton("Exit", 925, 10, 65, 20) ; ============================================================================ ; Main Loop ; ============================================================================ While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_Button_Exit Exit EndSelect WEnd Do I have to set this up as an embedded webpage or can I just add the pic somehow? Edit: Perhaps I could dl the pic with part of the script and then load it. I would really like to avoid having to embed it. Edited December 27, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
DW1 Posted December 27, 2007 Share Posted December 27, 2007 (edited) Like this? #include <GUIConstants.au3> $GUI = GUICreate("", 1024, 600, Default, Default, $WS_POPUPWINDOW) InetGet( "http://www.autoitscript.com/forum/uploads/profile/photo-24404.jpg", @TempDir & "\guipic.jpg", 1 ) $GUI_Pic_Map = GUICtrlCreatePic(@TempDir & "\guipic.jpg", 0, 0, 600, 600) GUISetState(@SW_SHOW, $GUI);Show GUI $GUI_Button_Exit = GUICtrlCreateButton("Exit", 925, 10, 65, 20) ; ============================================================================ ; Main Loop ; ============================================================================ While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_Button_Exit Exit EndSelect Wend EDIT: missing Wend Edited December 27, 2007 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted December 27, 2007 Share Posted December 27, 2007 And yes, you could also do the embedded IE like this: #include <GUIConstants.au3> #include <IE.au3> $GUI = GUICreate("", 1024, 600, Default, Default, $WS_POPUPWINDOW) $oIE = _IECreateEmbedded() $browser = GUICtrlCreateObj($oIE, 0, 0, 600, 600) _IENavigate( $oIE, "about:blank" ) $shtml = "" $shtml &= "<HTML><HEAD></HEAD>" & @CR $shtml &= '<BODY><IMG src="//www.autoitscript.com/forum/uploads/profile/photo-24404.jpg" alt="alternative text" width="550" height="550"></BODY></HTML>' $IEdoc = _IEDocWriteHTML($oIE, $shtml ) GUISetState(@SW_SHOW, $GUI);Show GUI $GUI_Button_Exit = GUICtrlCreateButton("Exit", 925, 10, 65, 20) ; ============================================================================ ; Main Loop ; ============================================================================ While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_Button_Exit Exit EndSelect WEnd AutoIt3 Online Help Link to comment Share on other sites More sharing options...
John117 Posted December 27, 2007 Author Share Posted December 27, 2007 Like this?'InetGet' learn something new everyday! exactly! Thanks, will be very useful in the future! Link to comment Share on other sites More sharing options...
John117 Posted December 27, 2007 Author Share Posted December 27, 2007 btw, what does you pic mean? Link to comment Share on other sites More sharing options...
DW1 Posted December 27, 2007 Share Posted December 27, 2007 My pic is from a punk band called "Crass". They are a peace through anarchy type punk band from the late 70's. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now