Ich habe einen Script:
Spoiler anzeigen
#include
#include
#include
Opt("GuiOnEventMode", 1)
$gui = GUICreate("Autoit-Mapper", 500, 500, -1, -1, $WS_POPUP)
$map = GUICtrlCreatePic(@DesktopDir & "\haus.jpg", 1, 1, 500, 500, -1)
GUICtrlSetState(-1, $Gui_Disable)
$punkt = GUICtrlCreatePic(@DesktopDir & "\punkt1.gif", 500 / 2 - 15, 500 / 2 - 15, 30, 30)
GUICtrlSetOnEvent(-1, "_DragIt")
GUISetState()
While 1
Sleep(100)
WEnd
Func _DragIt()
Local $Pos_C, $Pos_M, $Pos_M2, $Opt_old
Local $dll = DllOpen("user32.dll")
$Opt_old = Opt('MouseCoordMode', 0)
$Pos_C = ControlGetPos($gui, "", $punkt)
$Pos_M = MouseGetPos()
$y_Offset = $Pos_M[1] - $Pos_C[1]
$x_Offset = $Pos_M[0] - $Pos_C[0]
While _IsPressed('01', $dll)
$Pos_M = MouseGetPos()
If $Pos_M <> $Pos_M2 Then
GUICtrlSetPos($punkt, $Pos_M[0] - $x_Offset, $Pos_M[1] - $y_Offset)
EndIf
$Pos_M = $Pos_M2
Sleep(50)
WEnd
DllClose($dll)
Opt('MouseCoordMode', $Opt_old)
EndFunc ;==>_DragIt
Anstadt auf das Bild zu klicken um es zu verschieben, will das Bild per Pfeiltasten steuern.
(Also Obere Pfeiltaste soll das Bild nach oben gehen.)
Jemand ne Idee ?
Edit bernd670: Quellcode formatiert und Spoiler-Tags gesetzt (ist das so schwer )
Ja der Code ging nicht nacheinander sondern alle 30+ Reihen hintereinander (d0npers)