SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Sep 24, 2002, 13:38 #1
- Join Date
- Aug 2001
- Location
- London
- Posts
- 2,475
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How can i detect colours of pixels on images
I need to mouseover a picture and return what color the pixel is that the mouse is pointing to, how can i do this?
-
Sep 24, 2002, 14:38 #2
- Join Date
- May 2002
- Location
- United States
- Posts
- 457
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't think that there is a built in function, although, using a workaround you can probably do it.
look here for info on finding the mouse position on the page: (in both ie and netscape)
http://www.dansteinman.com/dynduo/en/mouseevents.html
then, you would need to create an array of every pixel of the image with the proper color...(you might be able to find a program that does this for you)
Hope that helpsCompwizard
"There are 10 kinds of people in this world -- those who know binary, and those who don't."
-
Sep 24, 2002, 16:02 #3
- Join Date
- Jan 2002
- Location
- London
- Posts
- 3,509
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you really do need to do this, you might be better off using Java - you could pass the image to be displayed as a parameter, and return the colour of the pixel that the mouse pointer that the image is hovering above as an RGB or Hex value. You might even be able to this in Flash...!
Perhaps you could explain exactly what you are trying to do - there may be a completely different way of achieving your aim.MarcusJT
- former ASP web developer / former SPF "ASP Guru"
- *very* old blog with some useful ASP code
- Please think, Google, and search these forums before posting!
Bookmarks