By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,821 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,821 IT Pros & Developers. It's quick & easy.

to select a potion of image on mouse click and change its color

P: 14
guys,

I need a small help here.. could u please tell me how i can change the color of a portion of an image on selecting that area with mouse.

please.

for e.g: we have the skeleton of human body, i select a small area in leg so that portion selected should have its color changed
Feb 1 '07 #1
Share this Question
Share on Google+
5 Replies

acoder
Expert Mod 15k+
P: 16,027
To do that, you will probably have to make the full image using parts. Each part of the image should have too versions: one normal and one coloured for selection.

When any image is clicked on, use onclick to call a function which will change the source of that image to the coloured version, e.g.
Expand|Select|Wrap|Line Numbers
  1. img.src='imgcol.gif';
Feb 1 '07 #2

P: 14
but that is so hard i mean a human body can have so many sections right.. i mean is it possible using imagemap.. creating a layer over it and then able to save that layer?
Feb 1 '07 #3

Atli
Expert 5K+
P: 5,058
Hi.

Is it not possible to create a transparent <div> element positioned ontop of the Image?

I'm kind of new to JS but thats what I'd try to do :P
Feb 1 '07 #4

iam_clint
Expert 100+
P: 1,208
Hi.

Is it not possible to create a transparent <div> element positioned ontop of the Image?

I'm kind of new to JS but thats what I'd try to do :P
yes its possible
Feb 1 '07 #5

acoder
Expert Mod 15k+
P: 16,027
but that is so hard i mean a human body can have so many sections right.. i mean is it possible using imagemap.. creating a layer over it and then able to save that layer?
The suggestion by Atli is better.

Also, have a look at these to see if they help:
http://frankmanno.com/ideas/css-imagemap-redux/
http://www.cssplay.co.uk/menu/imap.html

Not exactly Javascript, but they might put you on the right track.
Feb 1 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.