In contrast to the continuous capture sample, the simple version uses functions from the mv.impact.acquire.helper namespace to simplify continuous acquisitions.
using System;
#if USE_DISPLAY
#endif
using mv.impact.acquire.examples.helper;
namespace mv.impact.acquire.examples
{
public class MyConsoleRequestListener
{
{
{
{
}
else
{
}
}
}
}
#if USE_DISPLAY
{
protected override void Dispose(bool disposing)
{
unlockData();
base.Dispose(disposing);
}
public MyDisplayRequestListener(String title) : base(title) { }
{
{
# if CLR_AT_LEAST_3_DOT_5
imageDisplay.SetImage(data.
request);
# else
# endif
imageDisplay.Update();
if (data_ != null)
{
}
data_ = data;
}
else
{
}
}
public void unlockData()
{
if (data_ != null)
{
imageDisplay.SetImage(IntPtr.Zero, 0, 0, 0, 0);
data_ = null;
}
}
}
#endif
class ContinuousCaptureSimple
{
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);
}
try
{
MyConsoleRequestListener consoleListener = new MyConsoleRequestListener();
rp.onRequestReady += consoleListener.requestReady;
#if USE_DISPLAY
using (MyDisplayRequestListener displayListener =
new MyDisplayRequestListener(String.Format(
"MyRequestListener for device {0}", pDev.
serial.
read())))
{
rp.onRequestReady += displayListener.requestReady;
#endif
Console.WriteLine("Initialising the device. This might take some time...");
Console.WriteLine("Press [ENTER] to end the application");
Console.ReadLine();
#if USE_DISPLAY
}
#endif
}
{
Console.WriteLine(
"An error occurred while opening the device " + pDev.
serial +
"(error code: " + e.Message + "). Press any key to end the application...");
Console.ReadLine();
}
}
}
}
This class and its functions represent an actual device detected by this interface in the current sys...
Definition Device.cs:91
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
An base class for exceptions generated by Impact Acquire.
Definition Exceptions.cs:9
A small helper class to administer various library search path related variables and paths.
Definition LibraryPath.cs:14
static void init()
Calling this method will add the folders containing unmanaged libraries to the systems library search...
Definition LibraryPath.cs:251
IntPtr read()
Reads a value from a property.
Definition PropertyPtr.cs:49
String read()
Reads a value from a property.
Definition PropertyS.cs:144
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
int number
Returns the number associated with this request.
Definition Request.cs:1194
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
readonly EnumPropertyI< TImageBufferPixelFormat > imagePixelFormat
An enumerated integer property (read-only) containing the pixel format of this image.
Definition Request.cs:1540
A class that can be used to display images in a window.
Definition ImageDisplayWindow.cs:15
A class containing data generated by a request ready event fired by instances of the class mv....
Definition RequestReadyEventArgs.cs:45
RequestReadyEventData data
Locks the data associated with this event so that the data can be accessed safely while holding the l...
Definition RequestReadyEventArgs.cs:142
A class containing data stored inside a mv.impact.acquire.helper.RequestReadyEventArgs event fired by...
Definition RequestReadyEventData.cs:18
Request request
A reference to the mv.impact.acquire.Request object that just became ready.
Definition RequestReadyEventData.cs:88
void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...
Definition RequestReadyEventData.cs:69
This namespace contains classes and functions that can be used to display images.
Definition Enumerations.cs:2
This namespace contains some small helper classes and convenience functions belonging to the image ac...
This namespace contains classes and functions belonging to the image acquisition module of this SDK.
Definition Enumerations.cs:2
Definition Enumerations.cs:2
Definition Enumerations.cs:2