Check Image is over another Image

P

Patrice

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)...
 
V

Varangian

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?
 
J

John Timney \( MVP \)

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
 
P

Patrice

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.
 
V

Varangian

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 ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top