The continuous acquisition is similar to the single capture. There is only one difference, this capture is implemented inside a thread.
Now you have the image and e.g. you can display it.
using System;
using System.Threading;
#if USE_DISPLAY
#endif
using mv.impact.acquire.examples.helper;
namespace mv.impact.acquire.examples
{
class ContinuousCapture
{
static void Main(string[] args)
{
Device pDev = DeviceAccess.getDeviceFromUserInput();
if (pDev == null)
{
Console.WriteLine("Unable to continue! Press any key to end the program.");
Console.Read();
Environment.Exit(1);
}
Console.WriteLine("Initialising the device. This might take some time...");
try
{
}
{
Console.WriteLine(
"An error occurred while opening device " + pDev.
serial +
"(error code: " + e.Message + "). Press any key to end the application...");
Console.ReadLine();
Environment.Exit(1);
}
#if USE_DISPLAY
#endif
bool terminated = false;
Console.WriteLine("Press [ENTER] to end the application");
Thread thread = new Thread(delegate ()
{
if (result !=
TDMR_ERROR.DEV_NO_FREE_REQUEST_AVAILABLE)
{
}
DeviceAccess.manuallyStartAcquisitionIfNeeded(pDev, fi);
int timeout_ms = 500;
int cnt = 0;
while (!terminated)
{
if (pRequest != null)
{
{
++cnt;
if (cnt % 100 == 0)
{
Console.WriteLine(
"Info from {0}: {1}: {2}, {3}: {4}, {5}: {6}", pDev.
serial.
read(),
}
#if USE_DISPLAY
# if CLR_AT_LEAST_3_DOT_5
# else
# endif
#endif
}
else
{
}
if (pPreviousRequest != null)
{
}
pPreviousRequest = pRequest;
}
}
DeviceAccess.manuallyStopAcquisitionIfNeeded(pDev, fi);
#if USE_DISPLAY
#endif
if (pRequest != null)
{
}
});
thread.Start();
Console.ReadLine();
terminated = true;
thread.Join();
#if USE_DISPLAY
#endif
}
}
}
This class and its functions represent an actual device detected by this interface in the current sys...
Definition Device.cs:91
const int INVALID_ID
A symbolic constant to define an invalid handle.
Definition Device.cs:178
void open()
Opens a device.
Definition Device.cs:209
readonly PropertyS serial
A string property (read-only) containing the serial number of this device.
Definition Device.cs:516
T read()
Reads a value from a property.
Definition EnumPropertyI.cs:342
The function interface to devices supported by this interface.
Definition FunctionInterface.cs:21
int imageRequestSingle()
Sends an image request to the mv.impact.acquire.Device driver.
Definition FunctionInterface.cs:656
Request getRequest(int nr)
Returns a const pointer to the desired mv.impact.acquire.Request.
Definition FunctionInterface.cs:452
int imageRequestWaitFor(int timeout_ms)
Waits for a request object to become ready.
Definition FunctionInterface.cs:1021
int imageRequestReset(int requestCtrlNr)
Deletes all requests currently queued for the specified mv.impact.acquire.ImageRequestControl.
Definition FunctionInterface.cs:575
bool isRequestNrValid(int nr)
Check if nr specifies a valid mv.impact.acquire.Request.
Definition FunctionInterface.cs:1098
An base class for exceptions generated by Impact Acquire.
Definition Exceptions.cs:9
static String getErrorCodeAsString(int errorCode)
Returns a string representation of a error.
Definition Exceptions.cs:48
IntPtr read()
Reads a value from a property.
Definition PropertyPtr.cs:49
String read()
Reads a value from a property.
Definition PropertyS.cs:144
Contains information about a captured buffer.
Definition Request.cs:77
readonly PropertyPtr imageData
A pointer property (read-only) containing the start address of the image data.
Definition Request.cs:1579
readonly PropertyI imageLinePitch
An integer property (read-only) containing the offset (in bytes) to the next line of each channel bel...
Definition Request.cs:1655
readonly EnumPropertyI< TRequestResult > requestResult
An enumerated integer property (read-only) defining the result of this request.
Definition Request.cs:1211
readonly PropertyI imageWidth
An integer property (read-only) containing the width of the image in pixels.
Definition Request.cs:1693
readonly PropertyI imageBytesPerPixel
An integer property (read-only) containing the number of bytes per pixel in this image.
Definition Request.cs:1679
bool isOK
Convenience function to check if a request has been processed successfully.
Definition Request.cs:1173
readonly PropertyI imageHeight
An integer property (read-only) containing the height of the image in pixels.
Definition Request.cs:1704
int unlock()
Unlocks the request for the driver again.
Definition Request.cs:619
Contains statistical information.
Definition Statistics.cs:10
readonly PropertyI errorCount
An integer property (read-only) containing the overall count of image requests which returned with an...
Definition Statistics.cs:82
readonly PropertyF framesPerSecond
A float property (read-only) containing the current number of frames captured per second.
Definition Statistics.cs:98
readonly PropertyF captureTime_s
A float property (read-only) containing the average time needed to capture an image.
Definition Statistics.cs:75
A class that can be used to display images in a window.
Definition ImageDisplayWindow.cs:15
readonly ImageDisplay imageDisplay
Returns a reference to the actual display object associated with this window.
Definition ImageDisplayWindow.cs:108
void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...
Definition ImageDisplayWindow.cs:85
void RemoveImage()
Removes the current image from the display.
Definition ImageDisplay.cs:327
void SetImage(IntPtr pData, int width, int height, int bipp, int pitch)
Sets the next image to display.
Definition ImageDisplay.cs:282
void Update()
Immediately redraws the current image.
Definition ImageDisplay.cs:333
TDMR_ERROR
Errors reported by the device manager.
Definition mvDriverBaseEnums.cs:2375
This namespace contains classes and functions that can be used to display images.
Definition Enumerations.cs:2