05-14-2020 03:27 PM
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?
05-14-2020 06:17 PM
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.
05-15-2020 07:29 AM
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 .
05-25-2022 01:13 AM
Hi cvier
Did you find an answer to this problem?
05-25-2022 02:40 AM
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: https://forums.ni.com/t5/LabVIEW/NET-picturebox-convert-to-LabView-image/m-p/3125944#M897890
05-25-2022 02:42 AM - edited 05-25-2022 02:44 AM
How good is your Google foo?
https://letmegooglethat.com/?q=LabVIEW+.Net+Picture+to+Image
First link is this thread: https://forums.ni.com/t5/LabVIEW/NET-picturebox-convert-to-LabView-image/td-p/3125712
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.