Resource Base
Table of contents

DCEPhotoListener

The interface that provide method for capturing photo from the camera.

interface com.dynamsoft.dce.DCEPhotoListener
Methods Description
photoOutputCallback The callback method for user to receive the captured photo.

photoOutputCallback

The callback method for user to receive the captured photo. User can complete the method by adding code to execute with the capture image.

photoOutputCallback(byte[] bytes)

Parameters

bytes: The byte data of the captured image.

Code Snippet

// Create an instance of DCEPhotoListener
DCEPhotoListener photoListener = new DCEPhotoListener() {
    @Override
    public void photoOutputCallback(byte[] bytes) {
        // Add your code to execute when photo is captured.
        // For example, you can use Dynamsoft Barcode Reader (DBR) to decode the byte image.
        try {
            BarcodeReader mReader = new BarcodeReader();
            mReader.decodeFileInMemory(bytes);
        } catch (BarcodeReaderException e) {
            e.printStackTrace();
        }
    }
};
// Since you have configured the photoOutputCallback.
// When you trigger takePhote method, the library firstly capture a photo
// When the photo is captured and stored in memory, it will be processed by DBR
mCameraEnhancer.takePhoto(photoListener);

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

version 2.3.11

  • Latest version
  • Version 4.x
    • Version 4.2.0
    • Version 4.0.2
    • Version 4.0.1
    • Version 4.0.0
  • Version 3.x
    • Version 3.0.3
    • Version 3.0.2
    • Version 3.0.1
    • Version 3.0.0
  • Version 2.x
    • Version 2.3.21
    • Version 2.3.20
    • Version 2.3.12
    • Version 2.3.11
    • Version 2.3.10
    • Version 2.3.5
    • Version 2.3.4
    • Version 2.3.3
    • Version 2.3.2
    • Version 2.3.1
    • Version 2.3.0
    • Version 2.1.4
    • Version 2.1.3
    • Version 2.1.1
    • Version 2.0.0
Change +