Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

CWIMAQImage ImageToArray usage in vb

I am trying to interface a new camera (1394) to an existing program in vb. I need get the image from a CWIMAQImage to a Leadtools image control. I can't find any docs on the CWIMAQImage object and explicitly how the ImageToArray works (in vb). Can anyone shed some light on it? Or any other hints. The documentation that came with with Vision is pretty sketchy at best.

Thanks,
Craig Lindstrom
0 Kudos
Message 1 of 6
(3,869 Views)
Nevermind I figured this one out it returns a byte array.
0 Kudos
Message 2 of 6
(3,862 Views)
How can you use this byte array? How can you convert the array into a bitmap image? Thanks.
0 Kudos
Message 3 of 6
(3,820 Views)

The ImageToArray function simply returns an array of bytes (0 to 255 integer values (for 8 bit images) for every pixel of the image). You can index through this array to use the value of any pixel you want.

You can save an image to a bitmap format using the imgSessionSaveBufferEx function in NI-IMAQ. See the NI-IMAQ Function Reference.

Also, if you have the Vision Development Module, the SaveImageToDisk method in VB is available.

0 Kudos
Message 4 of 6
(3,801 Views)
I saw the discussion above and my question is when I installed NI-IMAQ, I can find active controls in Visual Basic, but I can not find the *.dll or *.lib that includes functions such as imgSessionSaveBufferEx, Can you tell how to find them? Thanks a lot.
0 Kudos
Message 5 of 6
(3,786 Views)
 
imgSessionSaveBufferEx is a C function call - the dll's and lib's were designed for C programming. For programming in VB, use only the activeX calls. You have access to all the functions with the activeX calls.
 
The IMAQ User Reference has a little bit of information about this. The IMAQ Vision for Visual Basic Manual has much more info.
 
Hope that helps!
0 Kudos
Message 6 of 6
(3,770 Views)