03-02-2011 03:19 PM
Hi
I am trying to draw a shape which is very much like a trapeziod on a graph. This shape comes from specifications and I am trying to show that the data lie within the bound formed by this shape. I can easily draw rectangle or square using the cursors, but drawing a triangle does not look straightforward to me. I can always plot any shape programmatically, which will appear on the graph while the VI runs. But, I want this shape to be there all the time, just like cursors. Can someone help?
Thanks
03-02-2011 03:33 PM - edited 03-02-2011 03:36 PM
Use the "plot images" property. It allows you to display anything (that you could also draw on an image indicator) on your graph.
(Here's an old example that draws circles, also look at the examples quoted on the help page)
You could use three (triangle) or four (trapezoid) moveable cursor dots and redraw the shape when their position changes.
03-02-2011 03:54 PM
Thanks. I like to know more about your last method. I created 3 moveable cursor points, but how do I redraw the lines when their position changes?
Thanks
03-02-2011 03:58 PM
Here is a similar example. You can click to create cursors and drag them around.
03-02-2011 04:19 PM
Thanks. It is cool, but I am looking for something simple using the cursors.
03-02-2011 04:25 PM
The can simplify Darin's code.
Remove all the logic to determine interior/exterior and reduce it to drawing the polygon when any of the cursors is moved. There won't be much code left. 😉