Jonvy

导航

Journeyapps ZXing android embedded学习 笔记

网址:

GitHub - journeyapps/zxing-android-embedded: Barcode scanner library for Android, based on the ZXing decoder

 

 

CameraPreview is a view that handles displaying of a camera preview on a SurfaceView. It is intended to be used as a base for realtime processing of camera images, e.g. barcode decoding or OCR, although none of this happens in CameraPreview itself.

The camera is managed on a separate thread, using CameraInstance.

Two methods MUST be called on CameraPreview to manage its state:

  1. resume() - initialize the camera and start the preview. Call from the Activity's onResume().
  2. pause() - stop the preview and release any resources. Call from the Activity's onPause().

Startup sequence:

  1. Create SurfaceView.
  2. open camera.
  1. layout this container, to get size
  2. set display config, according to the container size
  3. configure()
  4. wait for preview size to be ready
  5. set surface size according to preview size
  6. set surface and start preview

 

posted on 2023-04-29 13:25  不亮  阅读(162)  评论(0)    收藏  举报