Skyrimfus

GUI ControlMove problems

1 post in this topic

#1 ·  Posted

Hello. I have a GUI that has a picture in it and I need to move that picture without it being on top of other GUI elements.

This is my code:

 

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <GDIPlus.au3>


#Region ### START Koda GUI section ### Form
$Form1 = GUICreate("Map", 600, 600, 2500, 100)
GUISetBkColor(0x0066ff)
$Map = GUICtrlCreatePic("MapHD.jpg", 0, 0, 4096, 4096)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form1)
    $hPen = _GDIPlus_PenCreate(0xFF000000,2)
    
_GDIPlus_GraphicsDrawLine($hGraphic,0,300,600,300,$hPen)
_GDIPlus_GraphicsDrawLine($hGraphic,300,0,300,600,$hPen)
 
 $MapX = 0
 $MapY = 0
 
While 1
ControlMove("Map","",$Map,$MapX+1,$MapY+1)
$MapX= GetMapX()
$MapY= GetMapY


    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            _GDIPlus_PenDispose($hPen)
            _GDIPlus_GraphicsDispose($hGraphic)
            _GDIPlus_Shutdown()
            Exit
    EndSwitch
WEnd

The function GetMapX and GetMapY are defined in my notepad as a list and it works perfectly fine. but the problem is that the Lines dissappear.(comment out controlMove to see the lines im talking about). Any ideas how to fix it.

Thanks!

Share this post


Link to post
Share on other sites



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