LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I draw a line across an intensity graph using the mouse?

I try to draw a line across an intensity graph. I use property nodes of decorations to draw the line. (I do not want to use an overlaid transparent picture control since I need to catch other mouse events in my VI)

PROBLEM: only lines running between NorthWest and SouthEast quadrants are drawn correctly, not those running from SW to NE.
0 Kudos
Message 1 of 17
(4,425 Views)
NW to SE lines will map naturally to top left and bottom right.

THis is not the case in SW to NE.

bundle your Y from NE with your X from SW and vise versa.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 17
(4,424 Views)
Thanks for the quick reply, Ben,

I think I did what you recommend (if I understand you correctly), but I can't get it to work.

It seems to me that decorations cannot be set programatically to run from SW to NE, although one can drag them in editor mode that way.

I tried all sorts of combinations of X and Y, but nothing worked. Would you mind to have a look at my VI and tell me what's wrong ?

Do you know any other way to draw a line onto an I-graph??
0 Kudos
Message 3 of 17
(4,424 Views)
Hi,

How about putting a picture behind it, with a black background, and making
the graph array transparent? The code will be much cleaner, and the result
will look the same...

Regards,

Wiebe.



"fahlers" wrote in message
news:5065000000080000008FED0000-1079395200000@exchange.ni.com...
> I try to draw a line across an intensity graph. I use property nodes
> of decorations to draw the line. (I do not want to use an overlaid
> transparent picture control since I need to catch other mouse events
> in my VI)
>
> PROBLEM: only lines running between NorthWest and SouthEast quadrants
> are drawn correctly, not those running from SW to NE.
Message 4 of 17
(4,424 Views)
Yes you are correct!

It looks like the sign of the slope is set at "drop" time.

I played with using two, one for each sign, but that did not act as I ahd hoped.

Try out Wiebe's approach. I am not sure if that will work without making you frame transparent.

You could take that one step farther and put an image of your frame in the picture control at the back, but then your line will be in the back.

You could use an invoke node on the graph and get its image, and stuff that in the same picture control as the line is in.

When you want to show the line, move the graph off screen grab it image and throw that in the picture that you put in the same place as the graph was.

This may sound complicated but the alternatives using just the
I graph would you almost re-invent the picture control using the I graph.

So...

Try out Wiebe's idea,

Else put graph in picture and re-arrange the user interface.

I will watch for updates because I obviously have something to learn here.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 17
(4,424 Views)
In the event you have to resort to my convoluted approach, these VI's may help get you started.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 6 of 17
(4,424 Views)
Wiebe, Ben,
thanks for your comments

I think none of the suggestions will work for my case, since
a) I want to use mouse events, cursor dragging etc. for the intensity graph, so I can't put a picture control on top, nor can I integrate the graph into the picture control

and

b) having the picture control behind the graph I can't see the line I'm drawing, unless I make the intensity graph array transparent (in which case I don't see the grap data)

... or am I missing something in Wiebe's idea??

(Here's what I actually want to do: I have a 2D data plot and what to show a profile of the data along an arbitrary line. This line I want to draw with the mouse as it is possible with any decent viewer for scanning probe microscopy data, e.g.
May
be this is something for the LV wishlist, or they (NI) fix the inconsistent behaviour of the decoration property node)


There was, as I found out in the meantime, a similar thread 2 years ago:
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000014E0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=draw+lin+in+intensity+graph&USEARCHCONTEXT_QUESTION_S=0
0 Kudos
Message 7 of 17
(4,424 Views)
I may have been to fast on that last idea.

If you can tolerate your user interface operating in two modes, you can come close.

Graph mode
Line will not be visable while you work with the graph.

Line mode
The image is grabed from the graph and inserted into the picture.
The graph is then hidden and the picture is now visable where the graph was.
User draws line on picture. Since the picture has an image of the graph, it will look like they are drawing on the graph.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 17
(4,424 Views)
And yet another...

If two modes are OK, just show and position the picture over top of the graph and go with the standard transparent picture approach.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 17
(4,424 Views)
The two modes idea sounds fine, I'll try it tomorrow and tell if it works.

Still I think there should be a simpler way in LV to do this...

Thanks again!


Franz
0 Kudos
Message 10 of 17
(4,424 Views)