Sign in to follow this  
Followers 0
Vaeb

Imagemap in a GUI

7 posts in this topic

#1 ·  Posted (edited)

Hi!

I would really like to make an imagemap in a Gui.

Is there another way then do it by labels?

Can an1 post an examle if there is another way?

greets

Vaeb

Edited by Vaeb

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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.

I would like to do it by coordinates.

Don't call FloodFill but Just look at principle of click on picture catching and retrieving of clicked position.

Share this post


Link to post
Share on other sites

Could you please give me an example?

I am really not able to understand how it works without getting an example.

Greets

I posted link to example which has 90% of your desired functionality.

Share this post


Link to post
Share on other sites

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

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
Sign in to follow this  
Followers 0