目录

class info
com.huawei.hms.mlsdk.common.LensEngine.PhotographListener

Represents a callback API called upon image data obtaining.

Sample Code

  1. // Start the LensEngine.
  2. lensEngine.run();
  3. // Execute lensEngine.photograph() to take a photograph.
  4. lensEngine.photograph(new LensEngine.ShutterListener() {
  5.    @Override
  6.    public void clickShutter() {
  7.         // This method is called when the shutter is touched.
  8.    }
  9. },new LensEngine.PhotographListener() {
  10.    @Override
  11.    public void takenPhotograph(byte[] data) {
  12.        // This method is called when the photographing is complete.
  13.        // The data parameter and the corresponding image data can be obtained here for further processing.
  14.    }
  15. });

Public Method Summary

Return typeMethod name
voidtakenPhotograph(byte[] data)

Public Methods

Method
public void takenPhotograph(byte[] data)
This method is called when image data is obtained.

Parameters

Parameter nameParameter desc
dataImage data in binary JPEG format.