Image Frame Source

Defined under the namespace Scandit.Datacapture.Core

ImageFrameSource
class ImageFrameSource : FrameSource

Added in version 6.21.0

To emit the frame set this object as the frame source for the DataCaptureContext and turn it on by changing the desired state to FrameSourceState.On. This frame source will turn off automatically after the frame is emitted.

Note

This frame source emits a single image and turns off again. To feed a continuous stream of frames from a camera your application owns, use SequenceFrameSource instead — see Sequence Frame Source.

Creating an ImageFrameSource per frame and setting it on the DataCaptureContext every time is orders of magnitude slower on this platform: each image has to be encoded to be passed over the bridge, and setting a frame source re-serializes the whole context.

create(image)
static create(image: string): ImageFrameSource

Added in version 6.21.0

Constructs a new ImageFrameSource from the provided string, which should contain a Base64 encoded image.

desiredState
get desiredState(): FrameSourceState

Added in version 6.21.0

Implemented from FrameSource. See FrameSource.desiredState.

getCurrentState()
getCurrentState(): Promise<FrameSourceState>

Added in version 6.21.0

Implemented from FrameSource. See FrameSource.getCurrentState.

addListener(listener)
addListener(listener: FrameSourceListener | null): void

Added in version 6.21.0

Implemented from FrameSource. See FrameSource.addListener().

removeListener(listener)
removeListener(listener: FrameSourceListener | null): void

Added in version 6.21.0

Implemented from FrameSource. See FrameSource.removeListener().

switchToDesiredState(state)
switchToDesiredState(state: FrameSourceState): Promise<void>

Added in version 6.21.0

Convenience method for FrameSource.switchToDesiredState(): it is same as calling FrameSource.switchToDesiredState() with the second argument set to null.