Camera Camera Class

Definition

Warning

This API is now obsolete.

The Camera class is used to set image capture settings, start/stop preview, snap pictures, and retrieve frames for encoding for video.

[System.Obsolete("This class is obsoleted in this android platform")]
[Android.Runtime.Register("android/hardware/Camera", ApiSince=1, DoNotGenerateAcw=true)]
public class Camera : Java.Lang.Object
type Camera = class
    inherit Object
Inheritance
Attributes

Remarks

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.

Constructors

Camera(IntPtr, JniHandleOwnership) Camera(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

ActionNewPicture ActionNewPicture

Broadcast Action: A new picture is taken by the camera, and the entry of the picture has been added to the media store.

ActionNewVideo ActionNewVideo

Broadcast Action: A new video is recorded by the camera, and the entry of the video has been added to the media store.

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
NumberOfCameras NumberOfCameras

Returns the number of physical cameras available on this device.

PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

AddCallbackBuffer(Byte[]) AddCallbackBuffer(Byte[])

Adds a pre-allocated buffer to the preview callback buffer queue.

AutoFocus(Camera+IAutoFocusCallback) AutoFocus(Camera+IAutoFocusCallback)

Starts camera auto-focus and registers a callback function to run when the camera is focused.

CancelAutoFocus() CancelAutoFocus()

Cancels any auto-focus function in progress.

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
EnableShutterSound(Boolean) EnableShutterSound(Boolean)
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetCameraInfo(Int32, Camera+CameraInfo) GetCameraInfo(Int32, Camera+CameraInfo)

Returns the information about a particular camera.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetParameters() GetParameters()

Returns the current settings for this Camera service.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Lock() Lock()

Re-locks the camera to prevent other processes from accessing it.

Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
Open() Open()

Creates a new Camera object to access the first back-facing camera on the device.

Open(Int32) Open(Int32)

Creates a new Camera object to access a particular hardware camera.

Reconnect() Reconnect()

Reconnects to the camera service after another process used it.

Release() Release()

Disconnects and releases the Camera object resources.

SetAutoFocusMoveCallback(Camera+IAutoFocusMoveCallback) SetAutoFocusMoveCallback(Camera+IAutoFocusMoveCallback)

Sets camera auto-focus move callback.

SetDisplayOrientation(Int32) SetDisplayOrientation(Int32)

Set the clockwise rotation of preview display in degrees.

SetErrorCallback(Camera+IErrorCallback) SetErrorCallback(Camera+IErrorCallback)

Registers a callback to be invoked when an error occurs.

SetFaceDetectionListener(Camera+IFaceDetectionListener) SetFaceDetectionListener(Camera+IFaceDetectionListener)

Registers a listener to be notified about the faces detected in the preview frame.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetOneShotPreviewCallback(Camera+IPreviewCallback) SetOneShotPreviewCallback(Camera+IPreviewCallback)
SetParameters(Camera+Parameters) SetParameters(Camera+Parameters)

Changes the settings for this Camera service.

SetPreviewCallback(Camera+IPreviewCallback) SetPreviewCallback(Camera+IPreviewCallback)
SetPreviewCallbackWithBuffer(Camera+IPreviewCallback) SetPreviewCallbackWithBuffer(Camera+IPreviewCallback)
SetPreviewDisplay(ISurfaceHolder) SetPreviewDisplay(ISurfaceHolder)

Sets the Surface to be used for live preview.

SetPreviewTexture(SurfaceTexture) SetPreviewTexture(SurfaceTexture)

Sets the SurfaceTexture to be used for live preview.

SetZoomChangeListener(Camera+IOnZoomChangeListener) SetZoomChangeListener(Camera+IOnZoomChangeListener)

Registers a listener to be notified when the zoom value is updated by the camera driver during smooth zoom.

StartFaceDetection() StartFaceDetection()

Starts the face detection.

StartPreview() StartPreview()

Starts capturing and drawing preview frames to the screen.

StartSmoothZoom(Int32) StartSmoothZoom(Int32)

Zooms to the requested value smoothly.

StopFaceDetection() StopFaceDetection()

Stops the face detection.

StopPreview() StopPreview()

Stops capturing and drawing preview frames to the surface, and resets the camera for a future call to StartPreview().

StopSmoothZoom() StopSmoothZoom()

Stops the smooth zoom.

TakePicture(Camera+IShutterCallback, Camera+IPictureCallback, Camera+IPictureCallback) TakePicture(Camera+IShutterCallback, Camera+IPictureCallback, Camera+IPictureCallback)

Equivalent to takePicture(shutter, raw, null, jpeg).

TakePicture(Camera+IShutterCallback, Camera+IPictureCallback, Camera+IPictureCallback, Camera+IPictureCallback) TakePicture(Camera+IShutterCallback, Camera+IPictureCallback, Camera+IPictureCallback, Camera+IPictureCallback)

Triggers an asynchronous image capture.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
Unlock() Unlock()

Unlocks the camera to allow another process to access it.

UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Events

FaceDetection FaceDetection
ZoomChange ZoomChange

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to