LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an interactive grid

Hi everyone,

 

I want to create a grid that can be drawn on. The grid will output the coordinates of the drawing strokes in the order that it's drawn. For example, if user drew a line starting at the center and going to the right, the output coordinates would be (0,0),(1,0), (2,0),(3,0),......... or to the left (0,0),(-1,0),(-2,0),......

 

I was following this post  and it could potentially work since the indices could be used as the coordinates, but it would only work for positive indices. I suppose it can be programmed to shift the indices when outputting but this seems rather inefficient.

 

Could someone point me in the right direction?

 

Thanks in advance! 😄

0 Kudos
Message 1 of 4
(2,654 Views)

There are many ways to do this.  One simple one (if you are only drawing straight line segments and want to play "Connect the Dots") is to create a Graph, define a Cursor, and program the Cursor to define beginnings and endings of line segments.

 

Suggestion -- before you start thinking about writing any LabVIEW code, write yourself a Document (Microsoft Word, NotePad, pen and paper) describing what you want to do, and how you want to do it.  If you are doing line segments, do you want to always click "Begin/End", or do you want to click "Begin, next point, next point, next point ..." (and worry about how to define "Last Point")?  Some other scheme?

 

Bob Schor

0 Kudos
Message 2 of 4
(2,641 Views)

Hi Bob_Schor,

 

Thanks for your prompt respond and for, again, being the first to reply to my post 🙂

 

So the drawings can be any shape and not just straight line. But I think what I want is a square grid that has, for now, 20 same size and evenly spaced boxes. When user click on a box, the box will change color, and append 3 numbers to an array. Two of the numbers are predefined by me and this will be specific to the box (coordinate). The last number will either be a default number or a user-defined number for that box. The draw starts when user clicks begin and ends when user clicks complete. 

This is the reason why I think the post I mentioned previously would potentially work. What do you think?

Crossing my fingers that I'm making more sense.

 

Thanks 🙂

 

0 Kudos
Message 3 of 4
(2,619 Views)

Hmm, it does look like the Picture or Intensity Graph method(s) would work.  I kind of like the Intensity Graph suggestion, but on the other hand, am happy I'm not trying to do this in LabVIEW ...

 

Bob Schor

Message 4 of 4
(2,598 Views)