Jump to content

Recommended Posts

Posted

ummm... yes... thats a good script, but...

I think its a bit over my level.

I just dont want to fill a part of a picture.

This is a part of my code:

$yellow = GUICtrlCreatePic(@ScriptDir & "\System\yellow.gif", "5", "5", "691", "631", $WS_CLIPSIBLINGS)
GUISetState()
$pic_hWnd = ControlGetHandle($Gui1,"",$yellow)

While 1
        $Msg = GUIGetMsg()
        Switch $Msg
            Case $og1
                $msgn = "ers"
                $n = "1"
                Dis()
                GUICtrlSetState($Bahnhofplatz, $GUI_ENABLE)
                While 1
                    $Msg = GUIGetMsg()
                    Switch $Msg
                        Case $yellow
                            Ort2()
                                                                Wend
        EndSwitch
WEnd
DLLCall("gdi32.dll","int","SelectObject","int",$pic_hdc[0],"int",$obj_orig[0])

I would like to do it by coordinates.

Posted

#include <GUIConstants.au3>
$color = 0xFF0000 Or 0x0000FF Or 0xFCFF00
Opt("mousecoordmode",2)

$gui = GuiCreate('Map of South America', 916, 800) 
$pic1 = GuiCtrlCreatePic(@ScriptDir & '\System\Imagemap1.bmp', 5, 5, 916, 790) ;Image is attached
GUISetState()

$pic_hWnd = ControlGetHandle($gui,"",$pic1)
$pic_hdc = DLLCall("user32.dll","int","GetDC","hwnd",$pic_hWnd)

$hBrush = DllCall("gdi32.dll", "long", "CreateSolidBrush", "int", 0xFF00FF) ; fill color
$obj_orig = DLLCall("gdi32.dll","int","SelectObject","int",$pic_hdc[0],"int",$hBrush[0])

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
    If $msg = $pic1 Then
        $mp = MouseGetPos()
        DllCall("gdi32.dll","int","FloodFill","int",$pic_hdc[0],"int",$mp[0],"int",$mp[1],"int",$color) ; border color
    EndIf
WEnd

DLLCall("gdi32.dll","int","SelectObject","int",$pic_hdc[0],"int",$obj_orig[0])
DLLCall("gdi32.dll","int","DeleteObject","int",$hBrush[0])

I tried something.

There should happen Func1() when i click into the red boarder.

And when i click into the blue boarder, Func2() should happen.

And when i click into the yellow boarder, Func3() should happen.

How can i do that?

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...