Orion122 Posted October 13, 2009 Share Posted October 13, 2009 (edited) #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> GUICreate("Toolbar", 250, 250) GUISetState() $b=GUICtrlCreateButton("", 10, 170, 100, 70, $BS_ICON) GUICtrlSetImage($b, @DesktopDir & "\mozilla-firefox1.jpg", 1) while 1 sleep(1000) WEnd When I run script the button is clear, without image. I tried with "shell32.dll" as filename and it works. I didn't make a func attached to button and other script parts cuz i discovered this problem and focused to solve it. Please help. I have Vista Home Premium Edited October 13, 2009 by Orion122 Link to comment Share on other sites More sharing options...
Zedna Posted October 13, 2009 Share Posted October 13, 2009 (edited) Look at FileInstall() and my Resource UDFhttp://www.autoitscript.com/forum/index.php?showtopic=51103EDIT:also try to use $BS_BITMAP style instead of $BS_ICON one Edited October 13, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Orion122 Posted October 14, 2009 Author Share Posted October 14, 2009 #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) FileInstall("C:\Users\MARCIN\Desktop\mozilla-firefox1.jpg", "C:\Users\MARCIN\Desktop\mozilla-firefox1") GUICreate("Toolbar", 250, 250) GUISetState() $b=GUICtrlCreateButton("MOZILLA", 10, 170, 100, 70, $BS_BITMAP) GUICtrlSetImage($b, "C:\Users\MARCIN\Desktop\mozilla-firefox1") GUISetOnEvent($GUI_EVENT_CLOSE, "close") while 1 sleep(1000) WEnd func close() Exit EndFunc I tried to write smth like this. I'm only reading about UDF. I'd be very thankful if u wrote here working script, ofc it's not na problem for u. I'm new in programming. Path to jpg is: C:\Users\MARCIN\Desktop\mozilla-firefox1 Link to comment Share on other sites More sharing options...
Zedna Posted October 14, 2009 Share Posted October 14, 2009 (edited) #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) FileInstall("C:\Users\MARCIN\Desktop\mozilla-firefox1.jpg", @TempDir & "\mozilla-firefox1.jpg") GUICreate("Toolbar", 250, 250) GUISetOnEvent($GUI_EVENT_CLOSE, "close") $b=GUICtrlCreateButton("MOZILLA", 10, 170, 100, 70, $BS_BITMAP) GUICtrlSetImage($b, @TempDir & "\mozilla-firefox1.jpg") GUISetState() while 1 sleep(1000) WEnd func close() Exit EndFunc Edited October 14, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Orion122 Posted October 14, 2009 Author Share Posted October 14, 2009 Don't work. Did u check it on ur comp? It may be a stupid question but, Is there any requirements for jpg to use in autoit? Link to comment Share on other sites More sharing options...
Zedna Posted October 14, 2009 Share Posted October 14, 2009 Don't work. Did u check it on ur comp? It may be a stupid question but, Is there any requirements for jpg to use in autoit?Now I tested it and it works fine with bmp, not with jpg.So convert your jpg image to bmp. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Orion122 Posted October 14, 2009 Author Share Posted October 14, 2009 Should I use @TempDir? I have this file on desktop so maybe @DesktopDir? I covered it to bmp and launched ur script and it don't work. Maybe my comp is haunted Link to comment Share on other sites More sharing options...
Zedna Posted October 14, 2009 Share Posted October 14, 2009 Should I use @TempDir? I have this file on desktop so maybe @DesktopDir? I covered it to bmp and launched ur script and it don't work. Maybe my comp is haunted Try it without FileInstall() first to see base concept is working. #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) ;~ FileInstall("C:\Users\MARCIN\Desktop\mozilla-firefox1.bmp", @TempDir & "\mozilla-firefox1.bmp") GUICreate("Toolbar", 250, 250) GUISetOnEvent($GUI_EVENT_CLOSE, "close") $b=GUICtrlCreateButton("MOZILLA", 10, 170, 100, 70, $BS_BITMAP) ;~ GUICtrlSetImage($b, @TempDir & "\mozilla-firefox1.bmp") GUICtrlSetImage($b, "C:\Users\MARCIN\Desktop\mozilla-firefox1.bmp") GUISetState() while 1 sleep(1000) WEnd func close() Exit EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Orion122 Posted October 14, 2009 Author Share Posted October 14, 2009 It works! xD Thanks a lot! So it's all about format 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