batfastad Posted March 31, 2009 Share Posted March 31, 2009 Hi everyone I'm building a small quiz script which reads/writes results from MySQL. I'm pretty new to using the GUI functions of AutoIt and I've used the Koda editor to design up my GUI. It all works fine and I can get data into and out of the input boxes correctly. I've also got a picturebox on the GUI and I'd like to get a particular PNG from a URL and insert it into that picture box in the GUI. Is that possible? Cheers, B Link to comment Share on other sites More sharing options...
Yashied Posted March 31, 2009 Share Posted March 31, 2009 Hi everyone I'm building a small quiz script which reads/writes results from MySQL. I'm pretty new to using the GUI functions of AutoIt and I've used the Koda editor to design up my GUI. It all works fine and I can get data into and out of the input boxes correctly. I've also got a picturebox on the GUI and I'd like to get a particular PNG from a URL and insert it into that picture box in the GUI. Is that possible? Cheers, Bexpandcollapse popup#Include <GDIPlus.au3> GUICreate('Test', 400, 400) $Pic = GUICtrlCreatePic('', 75, 75, 250, 250) GUISetState() _SetImage($Pic, '1.png') Sleep(1000) _SetImage($Pic, '2.png') Sleep(1000) _SetImage($Pic, '3.png') do until GUIGetMsg() = -3 func _SetImage($controlID, $sFileName) local $hWnd, $hImage, $hBitmap $hWnd = GUICtrlGetHandle($controlID) if not IsPtr($hWnd) then return SetError(1, 0, 0) endif if not GUICtrlSetImage($controlID, '') then return SetError(1, 0, 0) endif _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromFile($sFileName) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() if $hBitmap = 0 then return SetError(1, 0, 0) endif _WinAPI_SetWindowLong($hWnd, -16, BitOR(_WinAPI_GetWindowLong($hWnd, -16), 0x0E)) _SendMessage($hWnd, 0x0172, 0, $hBitmap) return SetError(0, 0, 1) endfunc; _SetImage My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Zedna Posted March 31, 2009 Share Posted March 31, 2009 (edited) For such simple task use InetGet() and then GUICtrlSetImage() Edited March 31, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Yashied Posted March 31, 2009 Share Posted March 31, 2009 For such simple task use InetGet() and then GUICtrlSetImage()Zedna, GUICtrlSetImage() does not work with PNG files. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Zedna Posted April 1, 2009 Share Posted April 1, 2009 Zedna, GUICtrlSetImage() does not work with PNG files.You are right. For PNGs there are workarounds on the forum, just search for them. Resources UDF ResourcesEx UDF AutoIt Forum Search 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