Jump to content


Photo

Pixle location of Image when Clicked


  • Please log in to reply
2 replies to this topic

#1 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 25 August 2006 - 02:11 PM

hahahaha, this is gonna be fun I think

Going to
http://onlyican.com/images.php
You will see an image
and if you play with the form at the bottom, u see that depending what you select, it makes a box turn black

This is using GD LIB
The orig image (green with the yellow stripes) is one image
THe black box is another image

What I am looking for, is if someone clicks on that image, for me to find out the image pixle location of where they clicked

I dont want the geographical location of the click (where 0,0 is the top left of the screen)
I need it to be the image location
(where 0,0 is the top left corner of the image)

I think this is client side scripts (Javascript), as I dont think it can be done in server side scripting(php)

By the way, You may have guessed. I am using php
Tell me the problem, I will try tell you the solution

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 25 August 2006 - 02:25 PM

If you use the image itself as a submit 'button', then php will pass the x and y co-ordinates (relative to the upper left corner of the image) of where it was clicked as the 'name' values of the submit button, i.e. $_POST['submit_x'] and $_POST['submit_y']
Legend has it that reading the manual never killed anyone.
My site

#3 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 25 August 2006 - 02:37 PM

Now I never knew that

Thanks
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users