I have an IDS UEye webcam and want to make a snapshot via the uEyeDotNet.dll (version 1.6.4.2).
At the moment I'm using this piece of code.
var camera = new Camera();
camera.Init(_deskCamInfo.UEyeId);
camera.Memory.Allocate();
camera.Acquisition.Capture();
Thread.Sleep(500);
int s32MemID;
camera.Memory.GetActive(out s32MemID);
Bitmap image;
camera.Memory.ToBitmap(s32MemID, out image);
var converter = new ImageConverter();
var imageData = (byte[])converter.ConvertTo(image, typeof(byte[]));
When I use my code with the Thread.Sleep(500)
I get the snapshot as expected and everything works fine. But if I remove the Thread.Sleep(500)
I get a black image and I really don't know why.
But I don't want to wait 500ms for each snapshot and would like to solve this problem without it.
In my original code I check each result value from the uEye methods and I get always an success. Just removed this checks because it's hard to read with all the if statements.