Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Using CQIMAQ ImageToArray in C#

To what type do I cast the return from axCWIMAQ.Images.Item(1).ImageToArray?

 

0 Kudos
Message 1 of 4
(3,397 Views)
Check out the NI Vision for Visual Basic Reference Help.  It gives detailed descriptions of the CWImaq functions.  Go to Start>>Programs>>National Instruments>>Vision>>Documentation>>NI Vision for Visual Basic Reference Help.  Then expand Objects Reference and scroll down and click on CWIMAQImage.  Then scroll down to the bottom of the page and click on the ImagetoArray method.
 
I cut and pasted this information from the manual:

If the image type is cwimaqImageTypeComplex, the output array is a 1D array of two elements. The first element is a 2D array containing the real plane, and the second element is a 2D array containing the imaginary plane.

If the image type is cwimaqImageTypeRGBU64, the output array is a 2D array of 1D arrays with 4 elements (the Red, Green, Blue, and Alpha channels of each pixel).

Christopher W.

0 Kudos
Message 2 of 4
(3,375 Views)
Are the values doubles, floats, ints?
0 Kudos
Message 3 of 4
(3,372 Views)
That's going to depend on your image type.  For instance if it is an 8-bit image it will be U8s.  If it is a 16 bit image it will be I16.
0 Kudos
Message 4 of 4
(3,366 Views)