Page 1 of 1

Creating a vector image with on-mouse hot spots?

Posted: 2013-01-15T04:04:28-07:00
by williamk
Guys, I'm new here, so I'm asking this before I get my head around things just to find out its not possible and spent hours and hours for nothing... so, please, could someone give me a hand?

I need to create a map that adjusts itself, this is easy, but I also need to be able to click on it and know which section I clicked. Is this possible?

What I will create is an Iridology map. (eye exam chart)

Thank you for any help.

Best Regards, WilliamK

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-15T04:23:19-07:00
by snibgo
ImageMagic doesn't contain tools that capture mouse clicks.

Other systems, such as Web languages, do contain such tools.

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-15T05:37:48-07:00
by williamk
Yes, I'm aware of that, but I wonder if via PHP I could detect if I'm hitting a vector area or not, something like that. Like games does.

For example, I have 4 circles in my vector, and I want to know if a X/Y position hits one of those circles and which one. ;-)

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-15T05:54:34-07:00
by Bonzo
Yes you can do it with php ( will give you the x and y cordinates in the URL ) but the page will reload. You may be able to do it with javascript and not have the page reload - I do not use javascript and so can not confirm this.

I did have a couple of php examples on my website but I have removed one and this one http://www.rubblewebs.co.uk/imagemagick/trials/imap.php is broken; I will try and have a look at it later if I remember.

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-15T10:15:38-07:00
by Bonzo
My example seems to be working OK now - when you click on a colour on the first page and go to the second page you can see the co-ordinates of the click in the URL.

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-16T03:37:22-07:00
by williamk
Thanks Bonzo, I will check out things pretty soon. Just to speed things up, could you please show me how you did that? :D

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-16T03:39:36-07:00
by williamk
Never mind, I saw the "click here to download the code" link.... :oops:

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-20T18:04:09-07:00
by anthony
Bonzo wrote:My example seems to be working OK now - when you click on a colour on the first page and go to the second page you can see the co-ordinates of the click in the URL.
Doesn't work for me (firefox v16 under linux)


Actually I liked you older example where you create a colored map of areas within an image, take the users click coordinates and look up the color in that color map to determine what area the user selected. Is that online somewhere?

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-21T11:20:13-07:00
by Bonzo
Doesn't work for me (firefox v16 under linux)
Strange as it works in Firefox 17.0.1 on Windows.
Actually I liked you older example where you create a colored map of areas within an image, take the users click coordinates and look up the color in that color map to determine what area the user selected. Is that online somewhere?
No I do not think it is, last thing I used it for was an imagemap on my gallery. I will look it out again and make another demo when I get time.

Re: Creating a vector image with on-mouse hot spots?

Posted: 2013-01-21T11:49:30-07:00
by snibgo
It works for me on Firefox 3.5.16 under Windows 7. As I moved the mouse around, it continuously showed the coordinates in the address bar.

Is Firefox now on v17? About time I upgraded, I suppose.