Jump to content

Recommended Posts

Posted

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

Posted

#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)

NEWHeader1.png

Posted (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 by OminousIdol

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...