Jump to content
Sign in to follow this  

Click areas in picture

Recommended Posts

I have a picture control which is supposed to look like a menu. The menu contains the picture of the menu and the labels. How do I check that a mouse click is in a certain area of pixels in the picture? I need it to check that the menu items inside the pic were clicked...

What command do I use?

:whistle: Eynstyne

F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post

Link to post
Share on other sites

If MouseClick("Left", $x, $y) Then



That? I dont know, Im just guessing. But in my head it works ^^;


That wouldnt work, sorry xD, You would have to click that tiny pixel =P

Edited by AzKay


Share this post

Link to post
Share on other sites



For the last example of that one using labels instead of the picture hotspot... you need to do something like this:

#include <guiconstants.au3>

$main = GUICreate('MyPic', 150, 150)
$pic = GUICtrlCreatePic(@DesktopDir & '\JPG_Files\Water lilies.jpg', 0, 0)
$label = GUICtrlCreateLabel('', 2, 86, 21, 24)
GUICtrlSetBkColor($label, -2)
GUICtrlSetState($pic, $GUI_DISABLE)


While 1
    $msg = GUIGetMsg()
    If $msg = - 3 Then Exit
    If $msg = $label Then MsgBox(0, 'Pic', 'The left most flower was clicked')
Because that was made when the background of the labels didn't need to be transparent (they already were). Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  

  • Create New...