Sign in to follow this  
Followers 0
eynstyne

Click areas in picture

3 posts in this topic

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



#2 ·  Posted (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 by AzKay

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

http://www.autoitscript.com/forum/index.ph...st&p=161995

Edit:

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')
WEnd
Because that was made when the background of the labels didn't need to be transparent (they already were). Edited by SmOke_N

[center]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.[/center]

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