Jump to content

How to draw a rubber-band bounding box


MartinMcD

Recommended Posts

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

Link to comment

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:

  1. 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.
  2. 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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.