This error can be reproduced by running the StreamDisplay example unmodified,
"%CVB%\Tutorial\Image Manager\Cvb.Net\StreamDisplay"
By default StreamDisplay loads ClassicSwitch.emu as source.
This will work fine with both Grab and Snap.
GenericLoad(@"%CVB%\Tutorial\ClassicSwitch.emu");
We set up av virtual camera by using the GEVServer.
"%CVB%\Tutorial\GEVServer\CSharp\CSGEVServer\bin\Release\CSGEVServer.exe"
In GEVServer we load a set of images (e.g. “ClassicSwitch.emu”).
We also set it to “Socker Driver (loopback)” as recommended.
We now have a virtual camera running. We then configure this in CVB Management Console so it is accessible through the GenICam driver. Save the config to GenICam.ini.
Now in the StreamDisplay example application we do File > Open… and select the GenICam driver:
"%CVB%\Drivers\GenICam.vin"
Now we aquire images from the virtual camera. Grab works perfectly, but Snap causes error.
line 134: streamHandler.Stream.GetTimedSnapshot() throws ArgumentException
with the following stack trace:
at Stemmer.Cvb.Runtime.InteropServices.Processing.GenericInvocation[TOut](StandardProcessingFunction1`1 fn)
at Stemmer.Cvb.Driver.BufferImage.ImageLayout.LinearLayout.CloneImage(Image image)
at Stemmer.Cvb.Driver.BufferImage.ImageLayout.CloneIMGHandle(IntPtr handle)
at Stemmer.Cvb.Driver.BufferImage…ctor(Device device, ImageLayout layout)
at Stemmer.Cvb.Driver.VinDevice.RingBufferVinStream.MakeSnapshotImage(IntPtr handle)
at Stemmer.Cvb.Driver.Stream.GetTimedSnapshot(UsTimeSpan timeSpan, WaitStatus& status)
at Stemmer.Cvb.Driver.Stream.GetTimedSnapshot(UsTimeSpan timeSpan)
at StreamDisplay.MainForm.snapToolStripMenuItem_Click(Object sender, EventArgs e)
in … CvbExamples\Cvb.Net\StreamDisplay\MainForm.Streaming.cs:line 134
Clearly this is not a problem in the StreamDisplay application code, but something deeper within Cvb.Net.
What is going wrong? How do I solve this?