Jump to content

Image Map


duncan_cowan

Recommended Posts

Hi,I have an image map on my page and i was wondering if the user selects a random pixel on the image, is there any way i could find out what area on the image map the pixel is in?Any help would be appreciated.thanks

Link to comment
Share on other sites

Hi,I have an image map on my page and i was wondering if the user selects a random pixel on the image, is there any way i could find out what area on the image map the pixel is in?Any help would be appreciated.thanks
I don't quite get what you mean. Do you mean that you have an image map and if a user selects a pixel you want it to tell you remotely which pixel they selected?
Link to comment
Share on other sites

I am struggling to try and understand what you are trying to do. If you are making an image map then you will need to know the coordinates of the area that you want to be a map.To do this open the image in a photo editting program, it can be as simple as MS Paint, when you hover your mouse over the pixel, it tells you its exact posistion usually in the bottom right hand corner. If you are using a rectangle shape, take the coordinates of the top left and the bottom right of the rectangle.Does this answer your question?

Link to comment
Share on other sites

ok i will put it a different way :) i have an image map, it consists of 2 areas (both polygons), the script or the user then choose a random pixel. I then need the script to find out what area of the image map the chosen pixel is in.Sorry its quite complicated. :)

Link to comment
Share on other sites

ok i will put it a different way :) i have an image map, it consists of 2 areas (both polygons), the script or the user then choose a random pixel. I then need the script to find out what area of the image map the chosen pixel is in.Sorry its quite complicated. :)
Oh, I think I understand! You need it to respond with a certain thing that only a script can do, when a user hovers over certain pixels? Kind of like an image map but more interactive?Im sorry, my knowledge of image maps ceases after linking to a page from clicking on a certain area.
Link to comment
Share on other sites

I suppose that another way to do it would to be to record, in a list, all the pixels in each area and then have the script search for the pixel in the list.the only problem is that it would take a while to select and record each pixel in an area, perhaps anyone knows of a way to select and record pixels quickly? perhaps some software, or a script?

Link to comment
Share on other sites

You can define a polygon on an image map, if that's what you're asking. You don't need to know what specific pixel they clicked on, you just define a region and say this region links to this page, and you define another region and say where it links to. If you want to have the user click on an image and have the browser send the coordinates that they clicked on to the server, then you can use <input type="image">.

Link to comment
Share on other sites

i do know how to make a polygon, but the script i am making needs to know what image map area a pixel is in without the user clicking anything.is there any way to make a list of all the pixels in an area of the image map without going through each one manually and writing it down? :)

Link to comment
Share on other sites

i do know how to make a polygon, but the script i am making needs to know what image map area a pixel is in without the user clicking anything.is there any way to make a list of all the pixels in an area of the image map without going through each one manually and writing it down? :)
To be honest I dont think there is any way of working out all of the pixels within a polygon other than just doing each one manually. Maybe try looking for something on the internet, possibly that might do it for you?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...