468,535 Members | 1,629 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,535 developers. It's quick & easy.

Check Image is over another Image

Hello

is there a way to check if an image is over another Image ?

thanks

Mar 31 '06 #1
9 1230
Client side using JavaScript ?

Some more context may help...

--
Patrice

"Varangian" <of****@gmail.com> a écrit dans le message de news:
11**********************@i40g2000cwc.googlegroups. com...
Hello

is there a way to check if an image is over another Image ?

thanks

Mar 31 '06 #2
how though ? is there a way to check?

Mar 31 '06 #3
My first thought would be to say that it overlaps if both x and y ranges are
overlapped (in this case they share a common region).

Also the whole context may help. For example if you describe what you are
doing one could suggest a way to avoid it rahter than checking for it (for
example by computing server side absolute non overlapping positions or by
using HTML placement)...

--
Patrice

"Varangian" <of****@gmail.com> a écrit dans le message de news:
11**********************@e56g2000cwe.googlegroups. com...
how though ? is there a way to check?

Mar 31 '06 #4
the x and y range has a problem though .... it is for one point only...
remember an image is large and x and y takes care of one point of an
image.. the upper left corner.

what do you mean by the whole context?..... what is HTML placement?

Mar 31 '06 #5
Could you perhaps check the x and y of both images (top left) from the
container, and then compare both sets of images (width, length) from origin
x to see if any of the measurements exist within the same spatial range.

For example, if x of image 1 is 100, and x of image 2 is 120, and image 1 is
30 wide it overlaps image 2 by 10
--
Regards

John Timney
Microsoft MVP

"Varangian" <of****@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
the x and y range has a problem though .... it is for one point only...
remember an image is large and x and y takes care of one point of an
image.. the upper left corner.

what do you mean by the whole context?..... what is HTML placement?

Mar 31 '06 #6
hmmm

so your saying if it overlaps in a positive value the image is over it ?

Mar 31 '06 #7
so it would seem

--
Regards

John Timney
Microsoft MVP

"Varangian" <of****@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
hmmm

so your saying if it overlaps in a positive value the image is over it ?

Apr 1 '06 #8
I was talking about a range i.e. each image has an upper left corner (x1,y1)
and a lower right corner (x2,y2)
If you have "A" and "B" images, you'll have to check if A.x1,A.x2 and
B.x1,B.x2 overlaps. The same for y. If both overlaps IMO it's that they
share a common region.

If you display images inside table cells for example, they won't overlap...

What I meant by the whole context is that IMO it's always worth to explain
what you actually trying to do.

Sometimes one ask how to do something particular because this is the
solution he thought about. But if he explains the whole problem (rather than
how to achieve the particular solution he found) someone else can suggest
another and possibly better solution.

--
Patrice

"Varangian" <of****@gmail.com> a écrit dans le message de news:
11**********************@e56g2000cwe.googlegroups. com...
the x and y range has a problem though .... it is for one point only...
remember an image is large and x and y takes care of one point of an
image.. the upper left corner.

what do you mean by the whole context?..... what is HTML placement?

Apr 3 '06 #9
thanks .. infact thats what I did and worked :D...... I was actually
asking more if there is a method approach to it (a ready built library
or method) rather a mathemtical approach.

the math approach works fine hehe ;)

Apr 5 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

27 posts views Thread by mrbog | last post: by
2 posts views Thread by Cynthia | last post: by
2 posts views Thread by Geoff | last post: by
2 posts views Thread by =?Utf-8?B?TWlrZSBPS0M=?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.