eynstyne Posted July 25, 2006 Share Posted July 25, 2006 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? 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] Link to comment Share on other sites More sharing options...
AzKay Posted July 25, 2006 Share Posted July 25, 2006 (edited) If MouseClick("Left", $x, $y) Then _DoThisFunction EndIF That? I dont know, Im just guessing. But in my head it works ^^; EDIT:: That wouldnt work, sorry xD, You would have to click that tiny pixel =P Edited July 25, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 25, 2006 Moderators Share Posted July 25, 2006 (edited) http://www.autoitscript.com/forum/index.ph...st&p=161995Edit: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) GUISetState() While 1 $msg = GUIGetMsg() If $msg = - 3 Then Exit If $msg = $label Then MsgBox(0, 'Pic', 'The left most flower was clicked') WEndBecause that was made when the background of the labels didn't need to be transparent (they already were). Edited July 25, 2006 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now