LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw rectangle at the Intensity graph (position where it is clicked )

Solved!
Go to solution

I am able to extract coordinates using mouse down and mouse up event structure but unable to draw the rectangle at the specified positions.I am getting coordinates at mouse down and mouse up event  in these bounds.I want to draw a rectangle at the position of coordinates but unable to do so.

0 Kudos
Message 1 of 9
(5,492 Views)

@sets wrote:

I am able to extract coordinates using mouse down and mouse up event structure but unable to draw the rectangle at the specified positions.I am getting coordinates at mouse down and mouse up event  in these bounds.I want to draw a rectangle at the position of coordinates but unable to do so.


The rectangle will draw in front of the data layer. You need to add data to the graph first.

 

EDIT: Use the coordinates, not the XY values.

 

Ben64

Message 2 of 9
(5,469 Views)
0 Kudos
Message 3 of 9
(5,432 Views)

sets a écrit :

still not working....


Like I said in my previous post it will draw on top on the data layer, you must add data to the graph before drawing the rectangle.

See attached.

 

Ben64

0 Kudos
Message 4 of 9
(5,424 Views)

cannot open your VI ....please save it for previous version labview 2011

0 Kudos
Message 5 of 9
(5,411 Views)
Message 6 of 9
(5,395 Views)

You need to account for the plot bounds. See my example (posted here) long ago.

Message 7 of 9
(5,387 Views)
Solution
Accepted by sets

One more thing, since you're using the Draw Rectangle function you need to deal with the cases where the rectangle is not drawn from top left to bottom right. You have to make sure the minimum X value goes to the LEFT input and the minimum Y value goes to the TOP input of the rect terminal of the Draw Rectangle vi. Use the Max & Min function from the comparison palette for this.

 

Ben64

Message 8 of 9
(5,354 Views)

Thanks alot......understood it.

0 Kudos
Message 9 of 9
(5,299 Views)