ZanaxNL Posted August 31, 2010 Share Posted August 31, 2010 Hey, I need to have clickable Pictures. i found this : #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON) GUICtrlSetImage(-1,"shell32.dll",22) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example But how to get a other picture then shell32.dll > 22 ? When i try other picture it does't show up. Thanks, Zanax Link to comment Share on other sites More sharing options...
ZanaxNL Posted August 31, 2010 Author Share Posted August 31, 2010 Can somone help please. I need to make a image with a button function thx Zanax Link to comment Share on other sites More sharing options...
kaotkbliss Posted August 31, 2010 Share Posted August 31, 2010 use $BS_BITMAP instead of $BS_ICON, you should then be able to use bmp images 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
ZanaxNL Posted August 31, 2010 Author Share Posted August 31, 2010 Thanks : ) Now only the resolution fixing. : ) Zanax Link to comment Share on other sites More sharing options...
Malkey Posted September 1, 2010 Share Posted September 1, 2010 This is an example of some click-able pictures. expandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <Misc.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg, $But1, $But2, $But3 GUICreate("My GUI") ; will create a dialog box that when displayed is centered $But1 = GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", 22) ; Supported types BMP, JPG, GIF(but not animated). $But2 = GUICtrlCreatePic(RegRead("HKLM\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & _ "\Examples\GUI\mslogo.jpg", 10, 65, 200, 40, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) $But3 = GUICtrlCreateButton("", 10, 110, 40, 40, $BS_BITMAP) GUICtrlSetImage(-1, RegRead("HKLM\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & _ "\Examples\GUI\Advanced\Images\Blue.bmp") GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $But1 MsgBox(0, "", " Button 1 pressed", 1) Case $But2 GUICtrlSetStyle($But2, -1, $WS_EX_STATICEDGE) Do Sleep(10) Until Not _IsPressed('01') ; Until left mouse button is released. GUICtrlSetStyle($But2, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) MsgBox(0, "", " Button 2 pressed", 1) Case $But3 MsgBox(0, "", " Button 3 pressed", 1) EndSwitch WEnd EndFunc ;==>Example Link to comment Share on other sites More sharing options...
ZanaxNL Posted September 1, 2010 Author Share Posted September 1, 2010 thanks. had already one. but thanks a lot : D (Y) Closed?! 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