MENU
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

.Net API Reference - BarcodeReader Video Methods


StartFrameDecoding

Starts a new thread to decode barcodes from the inner frame queue.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.StartFrameDecoding(int maxQueueLength, int maxResultQueueLength, int width, int height, int stride, EnumImagePixelFormat imagePixelFormat, string templateName)

Parameters

[in] maxQueueLength <int> : The max count of frames waiting for decoding.
[in] maxResultQueueLength <int> : The max count of frames whose results (text result/localization result) will be kept for further reference.
[in] width <int> : The width of the frame image in pixels.
[in] height <int> : The height of the frame image in pixels.
[in] stride <int> : The stride of the frame image (also called scan width).
[in] imagPixelFormat <EnumImagePixelFormat> : The image pixel format used in the image byte array.
[in] templateName <string> : The template name.

Return value

Returns error code.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
EnumErrorCode error = reader.StartFrameDecoding(2, 10, 1024, 720, 720, EnumImagePixelFormat.IPF_BINARY, "");
reader.Dispose();

 

StartFrameDecodingEx

Starts a new thread to decode barcodes from the inner frame queue.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.StartFrameDecodingEx(ref FrameDecodingParameters parameters, string templateName) 

Parameters

[in] parameters <FrameDecodingParameters> : The frame decoding parameters.
[in] templateName <string> : The template name.

Return value

Returns error code.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
FrameDecodingParameters parameters = reader.InitFrameDecodingParameters();
parameters.MaxQueueLength = 3;
parameters.MaxResultQueueLength = 10;
parameters.Width = 20;
parameters.Height = 30;
parameters.Stride = 10;
parameters.ImagePixelFormat = EnumImagePixelFormat.IPF_GRAYSCALED;
parameters.Region.RegionMeasuredByPercentage = 1;
parameters.Region.RegionTop = 0;
parameters.Region.RegionBottom = 100;
parameters.Region.RegionLeft = 0;
parameters.Region.RegionRight = 100;
parameters.Threshold = 0.1;
parameters.FPS = 0;
EnumErrorCode error = reader.StartFrameDecodingEx(ref parameters, "");
reader.Dispose();

 

AppendFrame

Append a frame image buffer to the inner frame queue.

int Dynamsoft.DBR.BarcodeReader.AppendFrame(IntPtr pBufferBytes)

Parameters

[in] pBufferBytes <IntPtr> : The array of bytes which contain the image data.

Return value

Returns the ID of the appended frame.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
int ret = reader.AppendFrame(pBufferBytes);
reader.Dispose();

 

StopFrameDecoding

Stop the frame decoding thread created by StartFrameDecoding or StartFrameDecodingEx.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.StopFrameDecoding()

Return value

Returns error code.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
EnumErrorCode err = reader.StopFrameDecoding();
reader.Dispose();

 

InitFrameDecodingParameters

Initialize frame decoding parameters with default values.

FrameDecodingParameters Dynamsoft.DBR.BarcodeReader.InitFrameDecodingParameters()

Return value

Returns the frame decoding parameters.

 

SetErrorCallback

Sets call back function to process errors generated during frame decoding.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.SetErrorCallback(CB_Error callbackFunction, IntPtr pUser)

Parameters

[in] callbackFunction <CB_Error> : Call back function.
[in] pUser <IntPtr> : Customized arguments passed to your function.

Return value

Returns error code.

Exceptions

BarcodeReaderException The exception thrown by Dynamsoft Barcode Reader.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
reader.SetErrorCallback(ErrorFunction, NULL);
EnumErrorCode error = reader.StartFrameDecoding(2, 10, 1024, 720, 720, IPF_BINARY, "");
reader.Dispose();

SetIntermediateResultCallback

Sets call back function to process intermediate results generated during frame decoding.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.SetIntermediateResultCallback(CB_IntermediateResult callbackFunction, IntPtr pUser)

Parameters

[in] callbackFunction <CB_IntermediateResult> : Call back function.
[in] pUser <IntPtr> : Customized arguments passed to your function.

Return value

Returns error code.

Exceptions

BarcodeReaderException The exception thrown by Dynamsoft Barcode Reader.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
PublicRuntimeSettings settings = new PublicRuntimeSettings();
settings = reader.GetRuntimeSettings();
settings.IntermediateResultTypes = (int)(EnumIntermediateResultType.IRT_ORIGINAL_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CLUSTERED_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE);
reader.UpdateRuntimeSettings(settings);
reader.SetIntermediateResultCallback(IntermediateResultFunction, NULL);
EnumErrorCode error = reader.StartFrameDecoding(2, 10, 1024, 720, 720, IPF_BINARY, "");
reader.Dispose();

SetTextResultCallback

Sets call back function to process errors generated during frame decoding.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.SetTextResultCallback(CB_TextResult callbackFunction, IntPtr pUser)

Parameters

[in] callbackFunction <CB_TextResult> : Call back function.
[in] pUser <IntPtr> : Customized arguments passed to your function.

Return value

Returns error code.

Exceptions

BarcodeReaderException The exception thrown by Dynamsoft Barcode Reader.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
reader.SetTextResultCallback(TextResultFunction, NULL);
EnumErrorCode error = reader.StartFrameDecoding(2, 10, 1024, 720, 720, IPF_BINARY, "");
reader.Dispose();

GetLengthOfFrameQueue

Get current length of the inner frame queue.

int Dynamsoft.DBR.BarcodeReader.GetLengthOfFrameQueue()	

Return value

Returns the length of the inner frame queue.

This page is compatible for:

Version 7.5

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest Version
  • version 7.6
  • version 7.5
Change +
© 2003–2020 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support