Udostępnij za pośrednictwem


CameraManager.GetCameraCharacteristics(String) Method

Definition

Query the capabilities of a camera device.

[Android.Runtime.Register("getCameraCharacteristics", "(Ljava/lang/String;)Landroid/hardware/camera2/CameraCharacteristics;", "")]
public Android.Hardware.Camera2.CameraCharacteristics GetCameraCharacteristics (string cameraId);
[<Android.Runtime.Register("getCameraCharacteristics", "(Ljava/lang/String;)Landroid/hardware/camera2/CameraCharacteristics;", "")>]
member this.GetCameraCharacteristics : string -> Android.Hardware.Camera2.CameraCharacteristics

Parameters

cameraId
String

The id of the camera device to query. This could be either a standalone camera ID which can be directly opened by #openCamera, or a physical camera ID that can only used as part of a logical multi-camera.

Returns

The properties of the given camera

Attributes

Exceptions

if the cameraId does not match any known camera device.

if the camera device has been disconnected.

Remarks

Query the capabilities of a camera device. These capabilities are immutable for a given camera.

From API level 29, this function can also be used to query the capabilities of physical cameras that can only be used as part of logical multi-camera. These cameras cannot be opened directly via #openCamera

Also starting with API level 29, while most basic camera information is still available even without the CAMERA permission, some values are not available to apps that do not hold that permission. The keys not available are listed by CameraCharacteristics#getKeysNeedingPermission.

Java documentation for android.hardware.camera2.CameraManager.getCameraCharacteristics(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • GetCameraIdList()
  • <xref:Android.App.Admin.DevicePolicyManager.SetCameraDisabled(Android.Content.ComponentName%2c+System.Boolean)>