how can i get the color value when we point the mouse on images?
how can i get the color value when we point the mouse on images?
You can't, insofar as I know.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Depending on how important it is, you could use php to do it.
It would be intense coding, probably beyond most people on the board here, but it IS possible, I think.
I don't really know how, but, generally,
You could have the point on which an image was clicked be transferred to a php interpretation page (not sure how, but there's a special way... I think its a default to send coordinates), then use that point to locate the pixel with php.
Php, in addition to programming and text stuff, can actually create and modify images.
Php could find that particular pixel of the image, somehow read a color value from it, then print that value to html.
No idea about using JS, though.
You could try to make that a JS operation... where you have an iframe or something that's the interpretation php page.. and when it was done, you'd somehow transfer the color code to the other window.
I dunno... it's complex.
You could try just making each pixel it's own image... it would be a page, but it's possible... just a lot of handcoding....
Actually, an imagemap of each pixel would do you more good and save you a bit of time coding...
How badly do you need it?![]()
Ah, now that's a good idea. Using PHP and GD with AJAX, this might actually be possible. I hadn't thought of that.
But yes, it does boil down to:This is one heck of a lot of effort, and not something to be undertaken for the purpose of a minor effect.How badly do you need it?
It would be easier to do using Flash or Java, still, as I posted in your other thread.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Hey, Twey... this is a random question, but also helpful for this thread.
How could you best get php working in a client-side-esque manor?
Obviously its serverside, but how could you get it to function in realtime, with javascript and the like?
That's somewhat ambiguous, but just pick an example and go with it or something... I'm curious... wondering how that might work....
I mean... obviously you could just refresh the page with js/meta and get the php to do itself again... but that doesn't work in many cases.
As I said, I'd use AJAX. This allows Javascript to send and receive data to and from a server-side script without refreshing the page. It's not entirely realtime, as there is lag, but it's closer to it than anything else.Unless used client-side.Obviously its serversideIt even has GTK bindings so one can create GUIs with it.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Hmm.... cool.
But... AJAX isn't anything special... it's just a paricular style of combining languages, right?
I can always look up more info... no matter right now anyway.
For a color picker, I'd recommend making one not as a picture, but as a specifically coded thing just for that. Use javascript, create some kind of map and have the point relate to math that will use the coordinate to generate a code. Better yet, make some sliders with JS or something then have those change the values, creating a text box entry with the HTML code for the color. Also use that same value as a dynamic element of the page to show what the color looks like. just use a table and use bgcolor to demonstrate. (Set the table to width/height 50px and should be a nice little 'image'.)
I'm still trying to find the similar example for my problem.
Hmm.... ok. i'm curious, so post when you find it.
Question... are you interested in the function of letting someone pick a color to serve that purpose, or actually being able to use any image you want and picking that pixel and the color?... it's very different.
I've seen image maps used this way but, it would be a pain if not impossible to make each pixel an area. Every block of 4 or 8 pixels might not be too bad if you are fanatical about it or can figure out a way to generate the code.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks