Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

display image cwimaqviewer in c#?

Solved!
Go to solution

i want to display a variable of the type bitmap in the cwimaqviewer from the vision library, how can this be done?

 

a workaround is to copy the image variable into the clipboard but this is not really proffessional

 

can anybode help me?

0 Kudos
Message 1 of 6
(3,771 Views)

Hi there,

 

One possibility is to save your image in the hard disc.

Use  cwimaqvision1.ReadImage(cwimaqviewer1.Image, yourPath, cwimaqviewer1.Palette) to load the image from the hard disc.

 

 

hope this could help.

0 Kudos
Message 2 of 6
(3,767 Views)
hi, thanks for the answer but is there really no other opinion to e.g convert a bmp into a cwimaq image file? that it is possible to attach the image?
0 Kudos
Message 3 of 6
(3,763 Views)

hi,

 

You can also create a new CWIMAQImage. Use ReadImage function to load your image to CWIMAQImage.   Then you can attach the image whenever you want. Pay attention that, the type of CWIMAQImage is U8 by default when a new one is created.

 

Is this what u want? 

0 Kudos
Message 4 of 6
(3,761 Views)
how can i convert a bmp into a cwimaqimage?
0 Kudos
Message 5 of 6
(3,758 Views)
Solution
Accepted by topic author kumi

hi,

 

Here is a example.

 

NationalInstruments.CWIMAQControls.CWIMAQImage IMAG_Source = new NationalInstruments.CWIMAQControls.CWIMAQImage();

IMAG_Source.Type = NationalInstruments.CWIMAQControls.CWIMAQImageTypes.cwimaqImageTypeRGB32; //depends on the source image.

CWIMAQVision1.ReadImage(IMAG_Source, "@c:\image.bmp", CWIMAQViewer1.Palette);

 

IMAG_Source is what you want.

 

 

 

 

0 Kudos
Message 6 of 6
(3,756 Views)