LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

transfer .net bitmap into LV picture or IMAQ image

Hello ,
 
did anybody know, how I can transfer  a dot net ( .net ) bitmap to a picture of LabView7.1  or a image in IMAQ. I did it by e.g. reading of the U32-array  ( RGB - Format ) from .net into IMAQ array to color image VI. It works, but it takes to long time ( about 1200 ms ). additionally  the system performance grows up to 100 %. Therefore i am looking for a solution as described first.
 
                                                                                                                                                                                                           thanks
                                                                                                                                                                                                                               bernd
 
attached a sreenshoot of the VI in work
 
 
 
0 Kudos
Message 1 of 8
(4,889 Views)
Your screenshot didn't make it through. When you say .NET Bitmap I'm assuming you're referring to the .NET Bitmap class, as opposed to a bitmap file on disk? If it's a bitmap on disk, there's LabVIEW functions that will read bitmap files directly.
0 Kudos
Message 2 of 8
(4,878 Views)
Hello ,
 
did anybody know, how I can transfer  a dot net ( .net ) bitmap to a picture of LabView7.1  or a image in IMAQ. I did it by e.g. reading of the U32-array  ( RGB - Format ) from .net into IMAQ array to color image VI. It works, but it takes to long time ( about 1200 ms ). additionally  the system performance grows up to 100 %. Therefore i am looking for a solution as described first.
 
                                                                                                                                                                                                           thanks
                                                                                                                                                                                                                               bernd
 
attached a sreenshoot of the VI in work
0 Kudos
Message 3 of 8
(4,860 Views)
 
Hello @smercurio
 
now, i have uploaded the attached VI in work. The first picture upload have been to large, I think.
I hope that my problem can better understand better and I am looking forward to response.
 
                                                                                                                                                  thanks
 
                                                                                                                                                                                                   Bernd
0 Kudos
Message 4 of 8
(4,856 Views)
bernd,
 
The time you measured is a combination of get pixels, convert to image data cluster, and send to the picture indicator.
This is a slow process.  Unless you plan to manipulate pixels, try to avoid it.  Use a .net control to display the image.
 
George Zou
George Zou
0 Kudos
Message 5 of 8
(4,846 Views)
Your post implies that the entire process from the conversion to an array to the display of an actual image is 1.2 seconds. However, your screenshot has text on it that implies the single act of getting the 2D array (which is before you do any kind of IMAQ-stuff) takes 1.2 seconds. Based on the code I think you mean the entire process is 1.2 seconds since you are measuring the time with the sequence frames. That said, I would tend to agree with George. That is also coupled with the fact that .NET in LabVIEW is generally much slower than using .NET in a language like VB.NET or C#.

Your second question was about converting the .NET Bitmap class directly to an Image. You seem to be doing this in the other part of the diagram as a second attempt. LabVIEW does not know how to convert a System.Drawing.Bitmap class to an IMAQ Image class, so that's why you get that error.
0 Kudos
Message 6 of 8
(4,835 Views)
Thank you for the answer.
 
it save me a lot of time for further efforts and shows me,  that the solutions in LV7  are limited to my problem.
In particular, showing of a dot Net bitmaps in LV7 is not possible.
If you George has not a solution in your tool kits, I have to stop my efforts.
( the raeson for staying at LV7 is, that we would like to integrate a special solution into a current, proved application ) 
But it seems that we have to change in the higher LV version ( >8.0). Is that right ?
 
                                                                                                                                       Bernd
 
 
0 Kudos
Message 7 of 8
(4,823 Views)

pwch wrote:
If you George has not a solution in your tool kits, I have to stop my efforts.
( the raeson for staying at LV7 is, that we would like to integrate a special solution into a current, proved application ) 
But it seems that we have to change in the higher LV version ( >8.0). Is that right ?
                                                                                                                                       Bernd

Bernd,
 
It depends on the .net control you're using.  I don't have one so I can't test.
You should be able to use LV invoke node to call GetHBITMAP, and return a handle.
If that's the case, there is a VI in my tool kits to display the image.
 
George Zou

 
George Zou
0 Kudos
Message 8 of 8
(4,815 Views)