MartinMcD Posted January 10, 2011 Report Share Posted January 10, 2011 Hello there, I was wondering if there is an easy/correct way of drawing a rubber-band/bounding box in Labview. I'll use it to let the user select a few points on a point. Getting the size that I need to draw the box is easy, my intention had been to then set the size & position of a transparent string control to give the outline of a box but of course I can't resize a string control at runtime, only set it's position. Any ideas would be great. I'll post back if I figure it out. Thanks, Martin Quote Link to comment
Yair Posted January 10, 2011 Report Share Posted January 10, 2011 You can resize a string control at run-time. You just need to use the specific properties, not the bounds property, which is read-only. That said, this will probably not help you, as even if the string part is colored transparent, it will still be on top of the graph, so any clicks there will be on the string control. Here are a couple of options: Use a decoration. A simple frame decoration allows click-throughs. The main problem with that is that it can't be customized much and that you need to parse the panel to get a reference to the decoration. The graphs in modern LV versions allow foreground and background pictures. You should be able to use the picture control VIs to create a rectangle image and then write it to the FG or BG image of the graph. The graph should also have a method to convert XY coords to FP coords, so it should make it relatively easy to decide where to draw the rectangle. Quote Link to comment
MartinMcD Posted January 11, 2011 Author Report Share Posted January 11, 2011 Thank you for the help, I shall try and implement the foreground picture idea, I hadn't realised they were available. Thanks, Martin Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.