Jump to content

Creating a thin line overlay with no borders


Recommended Posts

A client purchased a NI RF device and is using the Soft Front Panel to view the power level over time.

The SFP displays a Chart with a running average of the power at the specified frequency.

They like everything about the SFP but would like a thin green line (10 x 1000) pixel line to be place by the operator to assist in setting a pass fail level.

I'm trying to create a semi transparent floating line independent of the SFP that the operator can move anywhere on the screen.

I've created a Vi set the panel to the color I want and made it semi transparent.

Attached is what I have so far.

Here are the issues that have me stumped.

  • The smallest height I can make a LabVIEW window is 50 pixels if I try to force it smaller an error is generated and the re-size is ignored.
  • I also want to eliminate the windows border and just show the selected color as a line

Anyone know of a better way to do this.

Is there way to do this in .NET

Thanks

Mark

Green LineCustomize VI Window.vi

Link to comment

I was able to create such a VI with the following settings:

post-2399-0-65583400-1334321751_thumb.pn

Here's the code I used for making it 10 pixels high:

post-2399-0-32263100-1334321875.png

And heres the FP overlaying the code:

post-2399-0-12852600-1334321973.png

And I would just ignore the error 1... (see attachment). (The reason your resize is ignored, is because the resizing outside the while loop generates an error, preventing the resize/move inside the event loop to happen.)

Ton

green line.vi

Link to comment

Ton's example still enforces a 50px minimum size for me. I've run into this as well, one of my application's has floating windows which appear as context information when the mouse moves over other VI panels, and I've not been able to size them smaller than 50px in either dimension.

Link to comment

Ton's example still enforces a 50px minimum size for me. I've run into this as well, one of my application's has floating windows which appear as context information when the mouse moves over other VI panels, and I've not been able to size them smaller than 50px in either dimension.

Maybe its an OS requirement?

Link to comment

Since you are open for a .NET solution I am guessing the Windows API solution would also be ok. Combine Ton's example with tst/Yair's example here:

http://forums.ni.com.../352929#M179807

Create a VI with a white background and a green object (2D picture with transparent frame for example) with the desired size (10 px height). Windows will remove the remaining white area from the FP and leave a semi-transparent green bar. Here it is on my Win7 machine:

post-26690-0-18309500-1334358721_thumb.p

Dragging is a bit finicky with Ton's example, I may play with it a bit. I have had similar issues trying to fake a title bar in a window.

Link to comment
  • 2 weeks later...

Since you are open for a .NET solution I am guessing the Windows API solution would also be ok. Combine Ton's example with tst/Yair's example here:

http://forums.ni.com.../352929#M179807

Create a VI with a white background and a green object (2D picture with transparent frame for example) with the desired size (10 px height). Windows will remove the remaining white area from the FP and leave a semi-transparent green bar. Here it is on my Win7 machine:

Dragging is a bit finicky with Ton's example, I may play with it a bit. I have had similar issues trying to fake a title bar in a window.

Here's a solution to fix the finicky dragging. Instead of trying to make the window a certain size and dragging it around, just drop a graph control and make everything transparent, but leave a green cursor. The image below shows the cursor overlaid over an Excel graph.

post-9308-0-30970900-1335237601_thumb.pn

The cursor makes the dragging really smooth. If the graph is set to fit to pane and the window set to maximized, I think you'll get the behavior you are looking for.

  • Like 1
Link to comment
  • 3 weeks later...

Why don't you just use the PlotImage.Front property?

Because Mark was "trying to create a semi transparent floating line independent of the SFP that the operator can move anywhere on the screen."

Plot images are great, but for using the plot image, you'd have to plot the data in that graph and not in just any independent window. Also, you'd still need a way to drag around the green line.

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.