Showing results for 
Search instead for 
Did you mean: 

C# PictureBox to Labview Image

Using a Camera that came with a C# dll.  Been able to mimic operation in Labview using invoke nodes to the .dll file.

Having an issue with bringing the picturebox picture into a Labview Image.  I can see the image appear in the picturebox on the Labview screen. Have been unsuccessful in being able to create an image picture in Labview from the  picturebox. The labview code is below, structured as an experiment..  I suspect I am missing something to get the picturebox Image to copy to a Labview picture.  So far always get a grey screen of the new picture indicator.

Any obvious thoughts on this?  





0 Kudos
Message 1 of 6

I think LabVIEW only sees the container when it takes an image, not whatever an external DLL puts into the container.


I think what you need to do is take that PictureBox.Image reference, and use additional .NET nodes to change that into a byte array and then reformat that array into a LabVIEW image format, or to whatever format you need (if the LabVIEW one was just an intermediate step, for instance).


I found this StackOverflow post on how to convert a .NET image to a byte array, but after that it depends on things like the size of the image and the bit depth of the image.

0 Kudos
Message 2 of 6

Read thru Stack Overflow and have been trying and reading for the last 2 days,  it is a little over my head to understand this enough to solve .

0 Kudos
Message 3 of 6

Hi cvier

       Did you find an answer to this problem?

0 Kudos
Message 4 of 6

There are VIs around for converting a .NET image or image in a picturebox to a 2D array of pixel values. I believe this should include it, for instance:

Try to take over the world!
Message 5 of 6

How good is your Google foo?


First link is this thread:


About the 6th post in that thread from LabVIEW Overlord Hooovahh, aka Brian, gives you exactly the solution! the rest of that thread might be interesting too.

Rolf Kalbermatter
Averna BV
Message 6 of 6