Hi,
I need to get the unique node assosicated given 2 sets of x and y coordinates.
I have the start and end coordinates of a selected region. And now I need to get the unique ID associated with both of it.
Please do let me know as soon as possible as to how I can go about doing this.
Thanks..
avz
5 2661 @avvz
You have to give some more detail: how are those x,y,ID triples stored? What is/are stored in those two sets? Just (x,y) coordinates or the Carthesian product of all coordinates? Are you looking for a position on a (geographical) map?
kind regards,
Jos
Hi Jos,
Thank you for replying.
The x and y coordinates, are the coordinates where the screen starts at (0,0),
So when the mouse clicks to select an area, (assume a square ), then i get the top left x y position and the bottom right x y position.
So now that I have these values, I need to get the unique ID from the DOM tree. I learnt that for each element on the HTML page there is a unique node id associated with it.
So I need to get the unique node ids with the pair of x n y coordinates I have got.
Please do let me know if you need more information.
Thanks,
Avanthi
For every component in that DOM tree you need to get the (x,y) (w,h) values (the top/left coordinate and width and height) and check whether or not they lie inside the given (x,y) (w, h) values. If the z value of those components is available as well, take the component which is nearest to the top of the z stack.
kind regards,
Jos
Hi Jos,
Thanks for the reply. Actually that is simliar to the logic I was thinking, but I just needed some code to go about doing this. So is there some code which I could get from anywhere?
@avvz
Do you know how to iterate over your components in your DOM? If so you have solved the major part of your problem already.
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rolf Kemper |
last post by:
Dear Experts,
I got stuck with the following problem and need your help.
What I wnat to do is to get a set of distinct nodes.
Before the distinct I have selected the multiple occourences...
|
by: xixi |
last post by:
we are using db2 udb v8.1 on win 64 bit with fp3 with type 4
db2jcc.jar driver.
i got some error extract from db2diag.log file, can someone explain me
what
this mean?
ID:1788 TID:3492...
|
by: Brian Henry |
last post by:
how do you determin what tree node something was drug onto? When I use the
e.x and e.y to get the current node at that point useing GetNodeAt, the e.X
and e.Y are not coordinates on the treeview,...
|
by: deko |
last post by:
I'm trying to implement a custom TreeView that shows a ghost image while
dragging. But the form I'm using is different from the sample code found
here:...
|
by: RichardHatcher.com |
last post by:
I am writing C code using xpath to extract some data from a XML
document. The file uses namespaces, but the name spaces are all listed
in the root node of the file as attributes. I want to...
|
by: Alan T |
last post by:
Can I find out which node was right clicked on a treeview?
|
by: dotnetnoob |
last post by:
i keep getting Object references not set to an instance of an object from
this code:
Private Sub EqBinding()
Dim x As Integer
x = 0
Do
If CStr(arlsType.Item(x)) = "Bacnet Point" Then
Dim...
|
by: wolfgang.schwarz |
last post by:
hi,
is there a way of getting the position and size of a text node in
Firefox without altering the DOM? For example, suppose I have a
document fragment like this:
<div>
textnode1
<img>...
|
by: Dennis |
last post by:
Hi, I have a text file that contents a list of email addresses like
this:
"foo@yahoo.com"
"tom@hotmail.com"
"jerry@gmail.com"
"tommy@apple.com"
I like to
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |