LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to put a .NET control with PictureBox at background (Z-order)

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.

0 Kudos
Message 1 of 10
(3,971 Views)

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 Smiley Indifferent.

 

Best Regards,

Bastian

 

 

0 Kudos
Message 2 of 10
(3,917 Views)

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.


___________________
Try to take over the world!
Message 3 of 10
(3,903 Views)

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.

0 Kudos
Message 4 of 10
(3,900 Views)

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.

0 Kudos
Message 5 of 10
(3,888 Views)

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.

0 Kudos
Message 6 of 10
(3,876 Views)

Without seeing the full applicatin it is hard to say why you are getting that error.

0 Kudos
Message 7 of 10
(3,864 Views)

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".

0 Kudos
Message 8 of 10
(3,855 Views)

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.

0 Kudos
Message 9 of 10
(3,851 Views)

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" :

http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__media__player.html#ga612605f2...

 

But this solution not easy with Labview, and for me...

0 Kudos
Message 10 of 10
(3,846 Views)