Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Resource Base
Table of contents

DCEPhotoListener

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

@protocol DCEPhotoListener <NSObject>
Method Type Description
photoOutputCallback required 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.

- (void)photoOutputCallback:(NSData *)jpegBytes;

Parameters

jpegBytes The byte data of the captured image.

Code Snippet

  • Objective-C
  • Swift
  1. @interface ViewController ()<DCEPhotoListener>
    - (void)configurationDCE(){
       // 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
       [_dce takePhoto:self]
    }
    - (void)photoOutputCallback:(NSData *)jpegBytes{
       // Add your code to execute when photo is captured.
       // For example, you can use Dynamsoft Barcode Reader (DBR) to decode the byte image.
       NSArray<iTextResult*> *barcodeResults = [_dbr decodeFileInMemory:jpegBytes error:nil];
    }
    
  2. class ViewController: UIViewController, DCEPhotoListener {
       func configurationDCE(){
          // 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
          dce.takePhoto()
       }
       func photoOutputCallback(_ jpegByte: Data){
          // Add your code to execute when photo is captured.
          // For example, you can use Dynamsoft Barcode Reader (DBR) to decode the byte image.
          let barcodeResults = try? dbr.decodeFileInMemory(jpegByte)
       }
    }
    

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    • Version 2.3.2
    • Version 2.3.1
    • Version 2.1.0
    • Version 2.0.0
    • Version 1.0.3
    • Version 1.0.1
    • Version 1.0.0
    Change +
    © 2003–2022 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support