Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get an image returned to VB (vs2008) From a Vision VI

I have a GIG-E camera working in a VI.

The Vi is compiled into a dll with several other VI's.

I am able to "return" doubles, integer etc no problem. Smiley Happy

 

Now I need to return an image and data...

The VI is a very simple:

Vision Acquision object --->IMAQImage Properties ----> Image out.   (And it works)

 

I linked the Image Out Indicator to a terminal so it would show in the DLL items to expose...

But it was gray in the Build tool so i set it as an argument.

 

I compiled the dll and tested the vi.

I can still call my other VI's such as Reading my HP meter.

 

Declare Auto Function Read6Fast Lib "C:\VI s\ReadMeter_.dll" (ByRef reset As Boolean) As Double

 ...

label_somelable.text = ReadSingle(True)

 ...

 

So am assuming I can do similar and return an image or a cluster

For example: 

Declare Auto Function Snap1 Lib "C:\VI s\ReadMeter_.dll" (ByRef tmp As Boolean, pic As BitMap)

...

SomeImageContaner.Image = pic

...

 

So How do I get a single Image out?

 

 

Cheers

0 Kudos
Message 1 of 3
(3,176 Views)

Hi,

 

The easiest (but not fastest) way is following - convert image to array and return two dimensional array from DLL

 

Andrey.

0 Kudos
Message 2 of 3
(3,160 Views)

Ok that makes some sense.

 

I was able to convert to an array.

Now, how do I cast it back to an image on the VB side?

I have an array of pixels right, Basically a bitmap?

 

cheers

 

0 Kudos
Message 3 of 3
(3,148 Views)