Kjodiz Posted March 17, 2011 Share Posted March 17, 2011 My boss gave me another task. He wants me to make a script that draws a yellow smiley with black background. Is this possible in AutoIt? Or do I have to use Visual Basic for this? I've looked around the internet for some tips, but all I can find is how to draw graphs... Link to comment Share on other sites More sharing options...
UEZ Posted March 17, 2011 Share Posted March 17, 2011 Yes it is possible. Look in help file for GUICtrlSetGraphic or GDI+. Btw, your boss is quite strange. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Kjodiz Posted March 17, 2011 Author Share Posted March 17, 2011 Thanks My boss gave me this task because I told him I'm interested in scripting. I'm an intern in IT support, and since I told him about my interest for scripting, he said that he would help me learn So first, he told me to create the well known "Hello World" text box, then he told me to create a survey which creates a text file and saves the number of times each buttons is pressed. And now he gave me this. Link to comment Share on other sites More sharing options...
Kjodiz Posted March 17, 2011 Author Share Posted March 17, 2011 ok I'm stuck.. I really don't understand this.. I know I'm noob and stuff.. But please help me out guys! Link to comment Share on other sites More sharing options...
JoHanatCent Posted March 17, 2011 Share Posted March 17, 2011 (edited) ok I'm stuck.. I really don't understand this.. I know I'm noob and stuff.. But please help me out guys! === And === I'm an intern in IT support, and since I told him about my interest for scripting, he said that he would help me learn So first, he told me to create the well known "Hello World" text box, then he told me to create a survey which creates a text file and saves the number of times each buttons is pressed. And now he gave me this. Looking at all this it is surely not you're boss's fault? And I see you already did some good scripting BUT does not show were you got stuck this time round! Did u look at any help as suggested by UEZ? Because I just cut that out and pasted and it almost looks like a face 2 me? #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Gui = GUICreate("My Draw", Default, Default, Default, Default, $ws_popup) $del = GUICtrlCreateButton("Delete", 50, 365, 50) $Graph1 = GUICtrlCreateGraphic(80, 10, 100, 100) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 150, 50, 40, 40) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 5, 50, 40, 40) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff) GUICtrlSetGraphic(-1, $GUI_GR_PIE, 100, 150, 40, 180, 190) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Sleep(13) WEnd GUIDelete() "Spellingz" Edited March 17, 2011 by JoHanatCent Link to comment Share on other sites More sharing options...
Kjodiz Posted March 17, 2011 Author Share Posted March 17, 2011 I looked at the help, but I didn't understand it.. I'm pretty new to scripting, so i don't understand everything in the help x) For example: GUICtrlSetGraphic ( controlID, type [, par1 [, ... par6]] ) I don't know what controlID is, and I couldn't find it ( Maybe I just didn't search good enough..) Same thing with the type, but I kinda lost hope when I tried hard to find out what the controlID was, and just couldn't.. So when I'm done with this task, I'm pretty sure that I'm gonna come back with some other questions about a weird script But thanks for the help! Link to comment Share on other sites More sharing options...
Kjodiz Posted March 18, 2011 Author Share Posted March 18, 2011 I'm almost done, but I can't find out how to create a background color. All i get is a little square. Help? #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Gui = GUICreate("My Draw", Default, Default, Default, Default, $ws_popup) $del = GUICtrlCreateButton("Delete", 50, 365, 50) $Graph1 = GUICtrlCreateGraphic(80, 10, 100, 100) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 150, 50, 40, 40) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 5, 50, 40, 40) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff) GUICtrlSetGraphic(-1, $GUI_GR_PIE, 100, 150, 40, 180, 190) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Sleep(13) WEnd GUIDelete() Link to comment Share on other sites More sharing options...
UEZ Posted March 18, 2011 Share Posted March 18, 2011 Try this: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Gui = GUICreate("My Draw", 380, 400, Default, Default, $ws_popup) $del = GUICtrlCreateButton("Delete", 50, 365, 50) $Graph1 = GUICtrlCreateGraphic(0, 0, 380, 400) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xff) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 250, 50, 40, 40) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 105, 50, 40, 40) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff) GUICtrlSetGraphic(-1, $GUI_GR_PIE, 200, 150, 40, 180, 190) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Sleep(13) WEnd GUIDelete() Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ 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