OminousIdol Posted July 22, 2006 Share Posted July 22, 2006 Hi, wrote a script to allow the Arrow Keys to move around a image... but it the flickers, grey background of the GUI will show through or random black lines will appear in the Image when it is being moved... I have no clue why its doing that and was wondering on how to fix it? This is the code I am using... expandcollapse popup#include <GUIConstants.au3> Dim $cX = 0 Dim $cY = 0 $image = "img1.jpg" HotKeySet("{UP}", "Up") HotKeySet("{Down}", "Down") HotKeySet("{Right}", "Right") HotKeySet("{Left}", "Left") GUICreate("test", 800, 600, 0, 0) $pic = GUICtrlCreateLabel("", $cX, $cY, 60, 60) GUICtrlSetBkColor($pic, 0x000000) GUISetState() While 1 $gMsg = GUIGetMsg() If $gMsg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func Up() $cY = $cY - 10 GUICtrlSetPos($pic, $cX, $cY) EndFunc ;==>Up Func Down() $cY = $cY + 10 GUICtrlSetPos($pic, $cX, $cY) GUICtrlSetResizing($pic, $GUI_DOCKSIZE) EndFunc ;==>Down Func Right() $cX = $cX + 10 GUICtrlSetPos($pic, $cX, $cY) EndFunc ;==>Down Func Left() $cX = $cX - 10 GUICtrlSetPos($pic, $cX, $cY) EndFunc ;==>Down Thank You Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 22, 2006 Share Posted July 22, 2006 The problem you are addressing is due to the background being drawn before the image is drawn again. To solve this, you must implement a second device context to draw on, which would be very complicated in AutoIt, or find a way to prevent the background from being redrawn. Link to comment Share on other sites More sharing options...
Helge Posted July 22, 2006 Share Posted July 22, 2006 I don't know if you're senile or anything, but there is seriously no need to createanother topic when you already got an identical one. Just post in that one !Just incase you infact are senile here is the link to to other topic. Link to comment Share on other sites More sharing options...
OminousIdol Posted July 22, 2006 Author Share Posted July 22, 2006 Na, just made a new topic because my old was in the wrong section and no one else responded to it... but anyways anyone have anything useful to tell me? Thanks Link to comment Share on other sites More sharing options...
Helge Posted July 22, 2006 Share Posted July 22, 2006 Ok, but I wouldn't call "v3 Support" the wrong forum, since it it is AutoIt v3 you're using, and you're also in the need for support. "v3 GUI" is an old forum and if I remember correctly it was created at the time when AutoIt didn't have the GUI- functions, but instead this forum was to be used for the special version of AutoIt that Larry made, named AutoIt-GUI (or something like that). Of course you couldn't have known that, but it's not needed to create another topic just to get it in the right forum either. The moderators would most likely have moved your first topic anyway Link to comment Share on other sites More sharing options...
OminousIdol Posted July 22, 2006 Author Share Posted July 22, 2006 Thats great... but that still doesnt help me... Link to comment Share on other sites More sharing options...
ivan Posted July 23, 2006 Share Posted July 23, 2006 (edited) @OminousIdol: I believe what Icekirby1 was trying to say is something similar to example 2 of GUICtrlCreatePic in the help file. Take a look at it, it does the same stuff you're trying to make and no flickering takes place. Hope this helps. IVAN Edited July 23, 2006 by ivan Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
eynstyne Posted July 25, 2006 Share Posted July 25, 2006 Use controlmove() it doesn't produce flickering F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent] 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