Android Programming Press on the image to return to the main documentation page.

Camera2

List of types:

Camera2
CameraSize

Camera2

Camera library based on Camera2 API. It should be used together with CamEx2 class.

Permissions:

android.permission.CAMERA

Events:

PictureTaken (Data() As Byte)
CameraState (Open As Boolean)
CameraClosed
SurfaceReady
SessionConfigured (Success As Boolean)
PreviewCaptureComplete (CaptureResult As Object)
PreviewTaken (Image As Object)
CaptureComplete (CaptureResult As Object)

Members:


  AbortCaptures

  AddCaptureRequest (Builder As Object) As Object

  CameraIDs() As String [read only]

  CreateCaptureBuilder As Object

  CreateMediaRecorder (VideoSize As CameraSize, Dir As String, FileName As String) As Object

  CreatePreviewBuilder As Object

  CreateSurface As ConcreteViewWrapper

  CreateVideoRequestBuilder As Object

  FindCameraId (Front As Boolean) As String

  GetCameraCharacteristics (Id As String) As Object

  GetSupportedCaptureSizes (Id As String) As List

  GetSupportedPreviewSizes (Id As String) As List

  GetSupportedVideoSizes (Id As String) As List

  Initialize (EventName As String)

  IsCameraOpen As Boolean [read only]

  OpenCamera (Id As String)

  SetRepeatingRequest (Builder As Object) As Object

  StartSession (Surface As android.view.TextureView, PreviewSize As CameraSize, CaptureSize As CameraSize, CaptureFormat As Int, PreviewFormat As Int, Video As Boolean)

  Stop

Members description:

AbortCaptures
Cancels previous requests.
AddCaptureRequest (Builder As Object) As Object
Adds a capture request.
CameraIDs() As String [read only]
Returns the ids of the available cameras.
CreateCaptureBuilder As Object
Creates a still capture builder.
CreateMediaRecorder (VideoSize As CameraSize, Dir As String, FileName As String) As Object
CreatePreviewBuilder As Object
Creates a preview request builder.
CreateSurface As ConcreteViewWrapper
Creates the surface view (TextureView) that will be used to display the preview frames.
You need to add it to the layout and wait for the SurfaceReady event.
CreateVideoRequestBuilder As Object
FindCameraId (Front As Boolean) As String
Returns the relevant camera id. Returns an empty string if not found.
GetCameraCharacteristics (Id As String) As Object
Returns an object that holds the camera supported features.
GetSupportedCaptureSizes (Id As String) As List
Returns a list with the supported capture sizes.
GetSupportedPreviewSizes (Id As String) As List
Returns a list with the supported preview sizes.
GetSupportedVideoSizes (Id As String) As List
Initialize (EventName As String)
IsCameraOpen As Boolean [read only]
OpenCamera (Id As String)
Opens the camera. The CameraState event will be raised.
SetRepeatingRequest (Builder As Object) As Object
Sets a repeating request (preview request). Clears any previous repeating request.
Returns the CaptureRequest object.
StartSession (Surface As android.view.TextureView, PreviewSize As CameraSize, CaptureSize As CameraSize, CaptureFormat As Int, PreviewFormat As Int, Video As Boolean)
Starts a capture session. The SessionConfigured event will be raised.
Stop
Stops the camera.

CameraSize


Events:

None

Members:


  Height As Int [read only]

  Initialize (Width As Int, Height As Int)

  IsInitialized As Boolean

  Width As Int [read only]

Members description:

Height As Int [read only]
Initialize (Width As Int, Height As Int)
IsInitialized As Boolean
Width As Int [read only]

Top