Udostępnij za pośrednictwem


Camera.IPreviewCallback.OnPreviewFrame(Byte[], Camera) Method

Definition

Caution

deprecated

Called as preview frames are displayed.

[Android.Runtime.Register("onPreviewFrame", "([BLandroid/hardware/Camera;)V", "GetOnPreviewFrame_arrayBLandroid_hardware_Camera_Handler:Android.Hardware.Camera/IPreviewCallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[System.Obsolete("deprecated")]
public void OnPreviewFrame (byte[]? data, Android.Hardware.Camera? camera);
[<Android.Runtime.Register("onPreviewFrame", "([BLandroid/hardware/Camera;)V", "GetOnPreviewFrame_arrayBLandroid_hardware_Camera_Handler:Android.Hardware.Camera/IPreviewCallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<System.Obsolete("deprecated")>]
abstract member OnPreviewFrame : byte[] * Android.Hardware.Camera -> unit

Parameters

data
Byte[]

the contents of the preview frame in the format defined by android.graphics.ImageFormat, which can be queried with android.hardware.Camera.Parameters#getPreviewFormat(). If android.hardware.Camera.Parameters#setPreviewFormat(int) is never called, the default will be the YCbCr_420_SP (NV21) format.

camera
Camera

the Camera service object.

Attributes

Remarks

Called as preview frames are displayed. This callback is invoked on the event thread #open(int) was called from.

If using the android.graphics.ImageFormat#YV12 format, refer to the equations in Camera.Parameters#setPreviewFormat for the arrangement of the pixel data in the preview callback buffers.

Java documentation for android.hardware.Camera.PreviewCallback.onPreviewFrame(byte[], android.hardware.Camera).

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