Damein Posted April 26, 2011 Share Posted April 26, 2011 (edited) For some reason I cannot get this to work: $CurrentImage = GuiCtrlCreatePic(@ScriptDir & "/Images/Image1.png", 0, 15, 200, 200) Is it because .png cannot be used? If so, I tried this as well: (I am downloading the image off a website, and its default is .png) I changed it using: InetGet($OverViewImage[1], @ScriptDir & "\Images\Image1.png") And I can see this image in the folder so I know its downloading. I tried chaing the .png to .jpg and tried using: $CurrentImage = GuiCtrlCreatePic(@ScriptDir & "/Images/Image1.jpg", 0, 15, 200, 200) But still no go, I just get a blank GUI. Edited April 26, 2011 by Damein Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
water Posted April 26, 2011 Share Posted April 26, 2011 (edited) According to the help file only BMP, JPG and GIF are supported. PNG can be used with GDI+. See example 3 in the help file for GUICtrlCreatePic. BTW: Some error checking will show you if the function does what you want it to do. If $CurrentImage = 0 then there was a problem. Edited April 26, 2011 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Jayson Posted April 26, 2011 Share Posted April 26, 2011 (edited) This does trick with .png images (from help file) : #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #Include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $hGUI, $hImage, $hGraphic, $hImage1 $hGUI = GUICreate("Show PNG", 250, 250) _GDIPlus_StartUp() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/Images/Image1.png") $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT") GUISetState() do until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _GDIPlus_ShutDown() ; Draw PNG image Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE) Return $GUI_RUNDEFMSG EndFunc Edited April 26, 2011 by Jayson Link to comment Share on other sites More sharing options...
Damein Posted April 26, 2011 Author Share Posted April 26, 2011 Thanks Jayson, worked great Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic 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