Text Capture Listener

Defined in namespace Scandit.DataCapture.Text.Capture

ITextCaptureListener
interface ITextCaptureListener

Added in version 6.5.0

Listener interface for traditional text capture.

OnObservationStarted()
void OnObservationStarted(TextCapture textCapture)

Added in version 6.5.0

Called when the listener starts observing the text capture instance.

OnObservationStopped()
void OnObservationStopped(TextCapture textCapture)

Added in version 6.5.0

Called when the listener stops observing the text capture instance.

OnTextCaptured()
void OnTextCaptured(TextCapture textCapture, TextCaptureSession session, IFrameData frameData)

Added in version 6.5.0

Invoked whenever at least one text has been captured. The newly captured texts can be retrieved from TextCaptureSession.NewlyCapturedTexts.

This method is invoked from a recognition internal thread. To perform UI work, you must dispatch to the main thread first.

Inside this method, you will typically want to start processing the captured texts somehow, e.g. by validating the text captured. Depending on the application, you will want to pause, or stop recognition, or continue reading texts:

  • To pause the capture session, but keep the camera (frame source) running, just set the text capture’s enabled property to false.

    textCapture.Enabled = false;
    
  • To stop the capture session, you will need to both disable the capture mode and stop the frame source. While it is possible to only stop the camera and keep the capture mode enabled, this may lead to additional capture events being delivered, which is typically not desired. The following lines of code show how to disable the capture mode and stop the frame source as well:

    // no more OnTextCaptured callbacks will be invoked after this call
    textCapture.Enabled = false;
    // asynchronously turn off the camera
    textCapture.Context.FrameSource.SwitchToDesiredState(FrameSourceState.Off, null);
    
TextCaptureEventArgs
class TextCaptureEventArgs : EventArgs

Added in version 6.12.0

Provides data for the TextCapture.TextCaptured event.

TextCaptureEventArgs()
TextCaptureEventArgs(TextCapture barcodeCapture, TextCaptureSession session, IFrameData frameData)

Added in version 6.12.0

TextCapture
TextCapture TextCapture { get; }

Added in version 6.12.0

Session
TextCaptureSession Session { get; }

Added in version 6.12.0

FrameData
IFrameData FrameData { get; }

Added in version 6.12.0

Text Capture Advanced Listener

Defined in namespace Scandit.DataCapture.Text