tomashen Posted November 29, 2011 Share Posted November 29, 2011 is it posible to make a square in gui and in that square u put image which u can move around with keyboard buttons... but when u move the image it will only move around that certain square. not like all over the gui Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
water Posted November 29, 2011 Share Posted November 29, 2011 Check the help file for GUICtrlCreatePic and try example 2. 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...
tomashen Posted November 29, 2011 Author Share Posted November 29, 2011 from wat i understand on it is... u basicaly create 2 guis? the gui on top is dragable by gui#1 ? and gui#2 is the movable image? Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
water Posted November 29, 2011 Share Posted November 29, 2011 (edited) Right. The picture GUI (gui#2) is a child of the main GUI (gui#1) Edited November 29, 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...
tomashen Posted November 29, 2011 Author Share Posted November 29, 2011 umm for some reason my picture on gui#2 wont show lmao... o.O Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
water Posted November 29, 2011 Share Posted November 29, 2011 Did you move the example script to another directory? The image has a relative path so you either have to change the path or copy the image as well. 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...
tomashen Posted November 29, 2011 Author Share Posted November 29, 2011 (edited) no path was changed ... but um never mind i fixed it.. my mistake was.. taht i mistakenly did GUICreate("", 0,1,2,3) ;i put 0 as 0 ;1 as 0; and 2/3 i put as the size i did the coords of GUICreate as for GUICtrlCreate... btu no w i fixed it.. EDIT: um also is there a way to get rid of flashing? Edited November 29, 2011 by tomashen Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
water Posted November 29, 2011 Share Posted November 29, 2011 When I run the example script I get no flashing on Windows 7 64bit. 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...
tomashen Posted November 29, 2011 Author Share Posted November 29, 2011 no no no i mean .. umm here expandcollapse popup$GUI=GUICreate("TEST...", 800, 600) $pic = GUICreate("", 400, 300, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $gui) $img = GUICtrlCreatePic("Dataimg.JPG", -1, -1, 800, 600) ;=================================================================== guisetstate(@SW_SHOW, $GUI) GUISetState(@SW_SHOW, $pic) while 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSe Exit 1 EndSwitch controls() WEnd Func controls() If _IsPressed("25") then If _IsPressed($SPEED_WALK_PRESS) Then move($NRML_MOVE) GUICtrlSetPos($img, $CHAR2[0]-1, $CHAR2[1]) Else move($FLY_MOVE) GUICtrlSetPos($img, $CHAR2[0]-1, $CHAR2[1]) EndIf map(1,1) EndIf If _IsPressed("26") Then If _IsPressed($SPEED_WALK_PRESS) Then move(10) GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]-1) Else move(50) GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]-1) EndIf map(1,1) EndIf If _IsPressed("27") Then if _IsPressed($SPEED_WALK_PRESS) Then move(10) GUICtrlSetPos($img, $CHAR2[0]+1, $CHAR2[1]) Else move(50) GUICtrlSetPos($img, $CHAR2[0]+1, $CHAR2[1]) EndIf map(1,1) EndIf If _IsPressed("28") Then If _IsPressed($SPEED_WALK_PRESS) Then move(10) GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]+1) Else move(50) GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]+1) EndIf map(1,1) EndIf Return EndFunc when im moving the image it flashes when being moved :/ Proud of AutoIt Proud of MySelf :) Link to comment Share on other sites More sharing options...
water Posted November 30, 2011 Share Posted November 30, 2011 I can't test your script because a lot of stuff is missing. But I think you get the flashing because of _IsPressed. This function returns true for quite some time. I tested with the following script and got about 64 milliseconds (press Tab to start the measurement and ESC to exit the script). So if your loop needs less time to process you will run the code for a key press multiple times. #include <Misc.au3> $hTime = TimerInit() While 1 If _IsPressed("09") Then ConsoleWrite(TimerDiff($hTime) & @CRLF) ; Tab If _IsPressed("1B") Then Exit ; ESC to exit the script WEnd 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...
UEZ Posted November 30, 2011 Share Posted November 30, 2011 Here?: 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