10-30-2013 10:41 AM
Hi,
When I create a new .NET container, I'm able to set background and foreground correctly (ctrl+J and ctrl+K). But when I insert a PictureBox (.NET) inside, I'm unable to set the Z-order, the .NET container is always on top. My goal is to put some "text field" above the .NET container. Is-it possible ?
Thanks, Julien.
11-07-2013 03:24 AM
Hi,
I came about the same issue.
I thought I could circumvent this issue by putting the VI, containing the .net picture element in a subpanel of a calling vi, and start it dynamically.
But this doesn't work, too. This only works if NO .net control is inside the vi. As soon as the control is initialized / the video is started it's put into front...
Maybe a Labview bug .
Best Regards,
Bastian
11-07-2013 05:10 AM
The reason for this behavior is that the .NET control is actually displayed in a separate window, which is why it's displayed above everything else in the FP, even if you put it in another VI and show that VI in a subpanel. I'm assuming that's a technical requirement to allow using the control.
I'm not sure if there's a good workaround, but I would consider displaying the additional info inside the .NET container itself (for instance, if it's a picture or if you can get multiple controls in a single container) or placing two containers in the same space or getting an image of the subpanel and displaying that instead of the subpanel itself (not practical if you want to interact with the control) or creating a separate window for the controls you want to have above the .NET control.
11-07-2013 05:17 AM
I found a way which could work for me (still testing).
I'm working with the directshow .net VIs. They contain a VI to convert the .net image to a labview image.
The labview image itself can be put into the background.
11-07-2013 11:47 AM
I've posted this VI (or others like it) before but I think it is quite handy. With it you are able to pull out an image from the PictureBox .NET control, then save it to a Memory Stream, then tell LabVIEW to open the stream as if it were an image file, then you have the data in LabVIEW and can display it like any other Picture data.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-08-2013 01:36 AM
Thanks for your ideas. Your VIs are very usefull.
My problem is solved if I use a picture like a PNG image file to put into the .NET container. But in some cases, I give the HWND of the .NET container to an extern library like the LIBVLC.DLL. This DLL play a video file and display it in the .NET picturebox. If I tried your VIs in this case, I have an error (attached picture). It seems there is no data in the .NET container, but the display isn't empty.
11-08-2013 07:38 AM
Without seeing the full applicatin it is hard to say why you are getting that error.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-08-2013 08:42 AM
Yes, I do a little soft to show the problem.
To execute it, you need to have the LIBVLC install version >= "1.1.11 the luggage". I think it's OK if you have VLC.
Open project and the "test.vi".
11-08-2013 09:02 AM
That is a really neat program. So I couldn't get the image from the picture box to be returned either. I'm guessing it is reserved by VLC which is putting images into it. As soon as the Stop function is called the image is removed so there's no hope of getting the image after VLC has released the PictureBox. I also couldn't get the image after it was paused either. I don't know what the SnapShot feature does but I couldn't get that to help either.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-08-2013 09:23 AM
The Snapshoot save to a PNG file a picture. (you need give the way of PNG when you call snapshoot). An other way to retieve the picture is to configure VLC differently with that "void libvlc_video_set_callbacks" :
But this solution not easy with Labview, and for me...