Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
Decode
Method | Description |
---|---|
startFrameDecoding |
Decode barcodes from inner frame queue. |
startFrameDecodingEx |
Decode barcodes from inner frame queue. |
appendFrame |
Append a frame image buffer to the inner frame queue. |
stopFrameDecoding |
Stop thread used for frame decoding. |
Parameter
Method | Description |
---|---|
initFrameDecodingParameters |
Initialize frame decoding parameter. |
Callback
Method | Description |
---|---|
setErrorCallback |
Set callback interface to process errors generated during frame decoding. |
setTextResultCallback |
Set callback interface to process text results generated during frame decoding. |
setIntermediateResultCallback |
Set callback interface to process intermediate results generated during frame decoding. |
Status retrieval
Method | Description |
---|---|
getLengthOfFrameQueue |
Get length of current inner frame queue. |
Start a new thread to decode barcodes from the inner frame queue with specific frame decoding setting passed in.
void com.dynamsoft.barcode.BarcodeReader.startFrameDecoding (final int maxQueueLength, final int maxResultQueueLength, final int width, final int height, final int stride, final int enumImagePixelFormat, final String templateName) throws BarcodeReaderException
maxQueueLength
The max number of frames waiting for decoding.
maxResultQueueLength
The max number of frames whose results (text result/localization result) will be kept.
width
The width of the frame image in pixels.
height
The height of the frame image in pixels.
stride
The stride (or scan width) of the frame image.
format
The image pixel format used in the image byte array.
templateName
The template name.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.setErrorCallback(new ErrorCallback() {
@Override
public void errorCallback(int frameId, int errorCode, Object userData) {
//TODO add your code for using error code
}
}, null);
reader.startFrameDecoding(2, 10, 1024, 720, 1024, EnumImagePixelFormat.IPF_GRAYSCALED, "");
Start a new thread to decode barcodes from the inner frame queue with specific frame decoding setting defined in FrameDecodingParameters
struct.
void com.dynamsoft.barcode.BarcodeReader.startFrameDecodingEx(FrameDecodingParameters parameters, String templateName) throws BarcodeReaderException
parameters
The frame decoding parameters.
templateName
The template name.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
FrameDecodingParameters parameters = reader.initFrameDecodingParameters();
parameters.maxQueueLength = 2;
parameters.maxResultQueueLength = 10;
parameters.width = 1024;
parameters.height = 720;
parameters.stride = 1024;
parameters.imagePixelFormat = EnumImagePixelFormat.IPF_GRAYSCALED;
reader.setErrorCallback(new ErrorCallback() {
@Override
public void errorCallback(int frameId, int errorCode, Object userData) {
//TODO add your code for using error code
}
}, null);
reader.startFrameDecodingEx(parameters, "");
reader.destroy();
Append a frame image buffer to the inner frame queue.
int com.dynamsoft.barcode.BarcodeReader.appendFrame(byte[] bufferBytes)
bufferBytes
The array of bytes which contain the image data.
Returns the ID of the appended frame.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.startFrameDecoding(2, 10, 1024, 720, 1024, EnumImagePixelFormat.IPF_GRAYSCALED, "");
int frameId = reader.appendFrame(bufferBytes);
reader.destroy();
Stop the frame decoding thread created by StartFrameDecoding
or StartFrameDecodingEx
.
void com.dynamsoft.barcode.BarcodeReader.stopFrameDecoding() throws BarcodeReaderException
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.startFrameDecoding(2, 10, 1024, 720, 1024, EnumImagePixelFormat.IPF_GRAYSCALED, "");
reader.stopFrameDecoding();
reader.destroy();
Initialize frame decoding parameters with default values.
FrameDecodingParameters com.dynamsoft.barcode.BarcodeReader.initFrameDecodingParameters() throws BarcodeReaderException
The frame decoding parameters.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
FrameDecodingParameters parameters = reader.initFrameDecodingParameters();
reader.destroy();
Set callback interface to process errors generated during frame decoding.
void com.dynamsoft.barcode.BarcodeReader.setErrorCallback(ErrorCallback errorCallback, Object userData) throws BarcodeReaderException
errorCallback
Callback interface.
userData
Customized arguments passed to your function.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.setErrorCallback(new ErrorCallback() {
@Override
public void errorCallback(int frameId, int errorCode, Object userData) {
//TODO add your code for using error code
}
}, null);
reader.startFrameDecoding(2, 10, 1024, 720, 1024, EnumImagePixelFormat.IPF_GRAYSCALED, "");
Set callback interface to process text results generated during frame decoding.
void com.dynamsoft.barcode.BarcodeReader.setTextResultCallback(TextResultCallback textResultCallback, Object userData) throws BarcodeReaderException
textResultCallback
Callback interface.
userData
Customized arguments passed to your function.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.setTextResultCallback(new TextResultCallback() {
@Override
public void textResultCallback(int frameId, TextResult[] results, Object userData) {
//TODO add your code for using text results
}
}, null);
reader.startFrameDecoding(2, 10, 1024, 720, 1024, EnumImagePixelFormat.IPF_GRAYSCALED, "");
Set callback interface to process intermediate results generated during frame decoding.
void com.dynamsoft.barcode.BarcodeReader.setIntermediateResultCallback(IntermediateResultCallback intermediateResultCallback, Object userData} throws BarcodeReaderException
intermediateResultCallback
Callback interface.
userData
Customized arguments passed to your function.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
PublicRuntimeSettings settings = reader.getRuntimeSettings();
settings.intermediateResultTypes = EnumIntermediateResultType.IRT_ORIGINAL_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CLUSTERED_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE;
reader.updateRuntimeSettings(settings);
reader.setIntermediateResultCallback(new IntermediateResultCallback() {
@Override
public void intermediateResultCallback(int frameId, IntermediateResult[] results, Object userData) {
//TODO add your code for using intermediate results
}
}, null);
reader.startFrameDecoding(2, 10, 1024, 720, 1024, EnumImagePixelFormat.IPF_GRAYSCALED, "");
Get length of current inner frame queue.
int com.dynamsoft.barcode.BarcodeReader.getLengthOfFrameQueue()
Returns length of current inner frame queue.
BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
int length = reader.getLengthOfFrameQueue();
reader.destroy();
version 7.6.0