cancel
Showing results for 
Search instead for 
Did you mean: 

.NET picturebox convert to LabView image

SOLVED
Norick_17
Member
Solved!

.NET picturebox convert to LabView image

I do have an IDS camera with the LV-driver. Unfortunately the driver uses .NET and therefore I have the camera image in a picturebox. Now I would like to do some image processing and therefore I

need to have the LabView image at this point and not the picturebox.

 

Question:

How can I "convert" the current picturebox into a LabView image? Saving and loading the image is no option because it would be to slow.

 

 

Thanks

27 REPLIES 27
Yamaeda
Proven Zealot

Re: .NET picturebox convert to LabView image

Is it the Picture to Pixmap you need?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Norick_17
Member

Re: .NET picturebox convert to LabView image

I do have the .NET picturebox. This picturebox I need to "convert" into a Imaq-image for further image processing.

Yamaeda
Proven Zealot

Re: .NET picturebox convert to LabView image

.NET is quite problematic, i hope someone has an answer as i'm eager to learn. Smiley Happy

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
alexderjuengere
Active Participant

Re: .NET picturebox convert to LabView image

Message contains an image Message contains an attachment

Norick_17 wrote:

Question:

How can I "convert" the current picturebox into a LabView image? Saving and loading the image is no option because it would be to slow.

 


there exists a methode node whith which you can copy the recent PictureBox content to clipboard in order to acces the image's bytes:

2015-04-27_picturebox_clipboard.PNG

 

Regards,
Alex

Hooovahh
Proven Zealot

Re: .NET picturebox convert to LabView image

Message contains an attachment

I posted these VIs before but I can't seem to find where.  Attached is some image utility VIs that do some interesting things with .Net.  Extract the zip and open the Demo Load Image.  This will load a PNG file with alpha layer transparencies and display it in a picture box.  You can then grey out the image and it does this by converting the image to LabVIEW data, applying an opacity change to 50% and then convert it back to .Net and display it.  I also have added some code showing how to get the image from a picture box, and then going from there.

 

The working part of this is taking the image, (from a picture box) and saving it to a stream as a PNG.  Then you use a vi in the vi.lib which takes a PNG stream and turn it into LabVIEW data image.  Being able to go from .Net image data, to LabVIEW and back is very powerful because you can do what is easiest in whatever platform you want and jump back and forth as needed.  This demo was originally made to demonstrate how .Net is good at transparencies and alpha layers, and LabVIEW is not, but you can combine the two to get what you want.

Norick_17
Member

Re: .NET picturebox convert to LabView image

Hello Alex

looks good but the output is a picture unfortunately. What I'm looking for is an imaq-image.

How can I get the RGB imaq-image?

 

thanks!

Norick_17
Member

Re: .NET picturebox convert to LabView image

Hello Hoooovah

the attached vi's are good but I think there is the same issue here. How can I get the imaq-image out of the 2D-picture?

 

Thanks

alexderjuengere
Active Participant
Solution

Re: .NET picturebox convert to LabView image

Message contains a hyperlink

@Norick_17 wrote:

How can I get the RGB imaq-image?

 


@Hooovahh, aka Labview-Overlord, showed us how to get the image data in bytes frome the .NET Picturebox, which is 1d Array of U8 values

 

Reshape this 1d Array to a 2d Array according to height and width of your input array and then feed this 2d array in the imaq_arraytocolorimage.vi

 

 

 

 

Norick_17
Member

Re: .NET picturebox convert to LabView image

Message contains an image

I added following code...

 

 

to imaq-image

 

 

 

 

 

and it works now!!!

 

Thanks a lot!