vin2 Posted June 27, 2015 Posted June 27, 2015 i have a script that generates 4 number results at a time, i want to display an image for every number generated. there's 52 numbers for 52 imagesi tried to add this partIf $iRandomResult1 = 1 Then $n1 = GUICtrlCreatePic("image1.gif", 50, 50, 0, 0) EndIfto this code expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Example() Func Example() Local $iRandomResult1 = 0 Local $iRandomResult2 = 0 Local $iRandomResult3 = 0 Local $iRandomResult4 = 0 Local $hGUI = GUICreate("Ace Play", 400, 250, -1, -1) Local $n1, $n2, $n3, $n4 Local $iButton1 = GUICtrlCreateButton("Play", 5, 215, 50, 30) Local $iButton10 = GUICtrlCreateButton("Clear", 60, 215, 65, 30) Local $iOutput1 = GUICtrlCreateLabel("", 60, 125, 30, 20, BitOR($BS_PUSHLIKE, $SS_CENTER)) Local $iOutput2 = GUICtrlCreateLabel("", 140, 125, 30, 20, BitOR($BS_PUSHLIKE, $SS_CENTER)) Local $iOutput3 = GUICtrlCreateLabel("", 225, 125, 30, 20, BitOR($BS_PUSHLIKE, $SS_CENTER)) Local $iOutput4 = GUICtrlCreateLabel("", 300, 125, 30, 20, BitOR($BS_PUSHLIKE, $SS_CENTER)) GUICtrlSetFont($iOutput1, 8, 800, "", "Comic Sans MS") GUICtrlSetFont($iOutput2, 8, 800, "", "Comic Sans MS") GUICtrlSetFont($iOutput3, 8, 800, "", "Comic Sans MS") GUICtrlSetFont($iOutput4, 8, 800, "", "Comic Sans MS") GUISetState(@SW_SHOW, $hGUI) ; Run the GUI until the dialog is closed While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iButton1 $iRandomResult1 = Random(1, 52, 1) $iRandomResult2 = Random(1, 52, 1) $iRandomResult3 = Random(1, 52, 1) $iRandomResult4 = Random(1, 52, 1) GUICtrlSetData($iOutput1, $iRandomResult1) GUICtrlSetData($iOutput2, $iRandomResult2) GUICtrlSetData($iOutput3, $iRandomResult3) GUICtrlSetData($iOutput4, $iRandomResult4) Case $iButton10 GUICtrlSetData($iOutput1, "") GUICtrlSetData($iOutput2, "") GUICtrlSetData($iOutput3, "") GUICtrlSetData($iOutput4, "") EndSwitch WEnd GUIDelete($hGUI) Exit EndFunc ;==>Exampleit doesn't seem to work
vin2 Posted June 27, 2015 Author Posted June 27, 2015 GUICtrlSetImange doesn't do what i want here's an example of before and after
Gianni Posted June 28, 2015 Posted June 28, 2015 https://www.autoitscript.com/forum/topic/131044-dice-and-cards-replacer/ Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
vin2 Posted June 28, 2015 Author Posted June 28, 2015 https://www.autoitscript.com/forum/topic/131044-dice-and-cards-replacer/ thanks a lot
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