OminousIdol Posted July 21, 2006 Posted July 21, 2006 I was trying to move a picture up/down on a GUI... but I cant get the picture to move? #include <GUIConstants.au3> $cX = 0 $cY = 0 HotKeySet("{Up}", "Up") HotKeySet("{Down}", "Down") GUICreate("test", 800, 600, 0, 0) GUICtrlCreatePic("img1.jpg", $cX, $cY, 50, 50) GUISetState() While 1 $gMsg = GUIGetMsg() WEnd Func Up() $cY = $cY - 5 EndFunc Func Down() $cX = $cX + 5 EndFunc This is what I tired to use to make the image move... Thank You
Valuater Posted July 21, 2006 Posted July 21, 2006 #include <GUIConstants.au3> Dim $cX = 0 Dim $cY = 0 $image = "C:\Temp\test.jpg" HotKeySet("{F8}", "Up") HotKeySet("{F9}", "Down") GUICreate("test", 800, 600, 0, 0) $pic = GUICtrlCreatePic($image, $cX, $cY, 50, 50) GUISetState() While 1 $gMsg = GUIGetMsg() WEnd Func Up() $cY = $cY - 5 GUICtrlSetPos($pic, $cX, $cY, 50, 50) EndFunc ;==>Up Func Down() $cY = $cY + 5 GUICtrlSetPos($pic, $cX, $cY, 50, 50) EndFunc ;==>Down 8)
OminousIdol Posted July 21, 2006 Author Posted July 21, 2006 (edited) GUICtrlSetPos, guess I missed that one hehe, it works perfect, moves up and down but how come when it moves, the image flickers a little bit? Anyway to fix this? I even tired to use a label but it still flickers when I move it around, does it have somtthing to do with the GUI? Thanks! Edited July 21, 2006 by OminousIdol
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