Mark Balla Posted April 13, 2012 Report Share Posted April 13, 2012 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 Quote Link to comment
Ton Plomp Posted April 13, 2012 Report Share Posted April 13, 2012 I was able to create such a VI with the following settings: Here's the code I used for making it 10 pixels high: And heres the FP overlaying the code: 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 Quote Link to comment
mje Posted April 13, 2012 Report Share Posted April 13, 2012 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. Quote Link to comment
Stagg54 Posted April 13, 2012 Report Share Posted April 13, 2012 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? Quote Link to comment
Ton Plomp Posted April 13, 2012 Report Share Posted April 13, 2012 I'm running WinXP Ton Quote Link to comment
mje Posted April 13, 2012 Report Share Posted April 13, 2012 I was on Win7-64. I'll spin up my virtual machines on Monday and see if I can get under 50 px. Quote Link to comment
Darin Posted April 13, 2012 Report Share Posted April 13, 2012 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. Quote Link to comment
ShaunR Posted April 14, 2012 Report Share Posted April 14, 2012 (edited) Another Win API example...... (press a key to stop it) Edited April 14, 2012 by ShaunR Quote Link to comment
ShaunR Posted April 14, 2012 Report Share Posted April 14, 2012 Hmmm. There is something weird with the vi that cannot be shrunk to less than 50px. If you create a new one you can shrink right down to the toolbar. Haven't figured out why that one is stuck. Quote Link to comment
Ravi Beniwal Posted April 24, 2012 Report Share Posted April 24, 2012 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. 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. 1 Quote Link to comment
Mark Balla Posted May 9, 2012 Author Report Share Posted May 9, 2012 Thanks everyone. Mark Quote Link to comment
MikaelH Posted May 9, 2012 Report Share Posted May 9, 2012 Why don't you just use the PlotImage.Front property? Quote Link to comment
MikaelH Posted May 9, 2012 Report Share Posted May 9, 2012 And why not do this... PlotImage2.vi ...just because we can. Quote Link to comment
Ravi Beniwal Posted May 11, 2012 Report Share Posted May 11, 2012 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. 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.