Machine Vision

Showing results for 
Search instead for 
Did you mean: 

Displaying multiple images using VBAI .NET

Go to solution

I am using the .NET api to  grab multiple images from my VBAI inspection profile.

In my VBAI inspection profile I have set 3 image variables and set them to the images I want to access in C# .NET.


Using the method

CapturedImage1 = engine.GetInspectionImage(Image1GUID, 1, 1, out newImageAvailable);

Where Image1GUID is the variable name I set. That works but when I tried to grab the next image CapturedImage2 = engine.GetInspectionImage(Image2GUID, 1, 1, out newImageAvailable);

it overwrites CapturedImage1 and now it seems like they are just pointing to the same image reference.


How do I grab multiple images without overwriting the old image so I can display 3 different images?

0 Kudos
Message 1 of 3
Accepted by topic author Txoov35lis

Currently there is just a single image created behind the scenes for each dotNET VBAI engine created. I just modified the dll to include a new GetInspectionImage function that allows you to pass in your own image. Now you can have:

(Call this once when app starts)

VisionImage image1 = new VisionImage();
VisionImage image2 = new VisionImage();


(call this to get the images from inspection)

engine.GetInspectionImage(Image1GUID, 1, 1, image1, out newImageAvailable);

engine.GetInspectionImage(Image2GUID, 1, 1, image2, out newImageAvailable);


Hope this helps,


Message 2 of 3

That worked!

0 Kudos
Message 3 of 3