Class Camera
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.Camera.dll
- API Level:
- 3
- Feature:
- http://tizen.org/feature/camera
This camera class provides methods to capture photos and supports setting up notifications for state changes of capturing, previewing, focusing, and informing about the resolution and the binary format, and functions for picture manipulations like sepia, negative, and many more. It also notifies you when a significant picture parameter changes, (For example, focus).
C#Copypublic class Camera : IDisposable
- Inheritance
-
System.ObjectCamera
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic Camera(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
CameraDevice | device | The camera device to access. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Invalid CameraDevice type. |
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | The camera feature is not supported. |
API Level: 3
Feature: http://tizen.org/feature/camera
Properties
Declaration
C#Copypublic int CameraCount { get; }
Property Value
Type | Description |
---|---|
Int32 | This returns 2, if the device supports primary and secondary cameras. Otherwise 1, if the device only supports primary camera. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The camera has already been disposed. |
API Level: 3
Declaration
C#Copypublic CameraCapabilities Capabilities { get; }
Property Value
Type | Description |
---|---|
CameraCapabilities |
API Level: 4
Declaration
C#Copypublic CameraFacingDirection Direction { get; }
Property Value
Type | Description |
---|---|
CameraFacingDirection | A CameraFacingDirection that specifies the facing direction of the camera device. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The camera has already been disposed. |
API Level: 3
Display
Sets or gets the display type and handle to show preview images. The camera must be in the Created state.
Declaration
C#Copypublic Display Display { get; set; }
Property Value
Type | Description |
---|---|
Display |
Remarks
This must be set before the StartPreview() method. In custom ROI display mode, DisplayRoiArea property must be set before calling this method.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
DisplayReuseHint
The hint for the display reuse. If the hint is set to true, the display will be reused when the camera device is changed with the ChangeDevice method.
Declaration
C#Copypublic bool DisplayReuseHint { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of invalid parameters. |
System.InvalidOperationException | An invalid state. |
ObjectDisposedException | The camera has already been disposed. |
API Level: 3
Declaration
C#Copypublic CameraDisplaySettings DisplaySettings { get; }
Property Value
Type | Description |
---|---|
CameraDisplaySettings |
API Level: 3
Declaration
C#Copypublic IntPtr Handle { get; }
Property Value
Type | Description |
---|---|
System.IntPtr |
API Level: 3
Feature: http://tizen.org/feature/camera
Declaration
C#Copypublic CameraSettings Settings { get; }
Property Value
Type | Description |
---|---|
CameraSettings |
API Level: 4
Declaration
C#Copypublic CameraState State { get; }
Property Value
Type | Description |
---|---|
CameraState | None, Created, Preview, Capturing, Captured. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The camera has already been disposed. |
API Level: 3
Methods
Declaration
C#Copypublic void ChangeDevice(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
CameraDevice | device | The hardware camera to access. |
Remarks
If display reuse is set using DisplayReuseHint before stopping the preview, the display will be reused and last frame on the display can be kept even though camera device is changed. The camera must be in the Created.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of invalid parameters. |
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of the ChangeDevice feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
API Level: 3
Feature: http://tizen.org/feature/camera
Declaration
C#Copypublic void Dispose()
API Level: 3
Feature: http://tizen.org/feature/camera
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
API Level: 3
Declaration
C#Copyprotected void Finalize()
Declaration
C#Copypublic static CameraDeviceState GetDeviceState(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
CameraDevice | device | The device to get the state. |
Returns
Type | Description |
---|---|
CameraDeviceState | Returns the state of the camera device. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of invalid parameters. |
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
API Level: 4
Feature: http://tizen.org/feature/camera
Declaration
C#Copypublic static CameraFlashState GetFlashState(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
CameraDevice | device | The device to get the state. |
Returns
Type | Description |
---|---|
CameraFlashState | Returns the flash state of the camera device. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of invalid parameters. |
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
API Level: 3
Feature: http://tizen.org/feature/camera
StartCapture()
Starts capturing of still images. EventHandler must be set for capturing using Capturing and for completed using CaptureCompleted before calling this method. The camera must be in the Preview state.
Declaration
C#Copypublic void StartCapture()
Remarks
This function causes the transition of the camera state from capturing to captured automatically and the corresponding EventHandlers will be invoked. The preview should be restarted by calling the StartPreview() method after capture is completed.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
StartCapture(Int32, Int32, CancellationToken)
Starts continuously capturing still images. EventHandler must be set for capturing using Capturing and for completed using CaptureCompleted before calling this method. The camera must be in the Preview state.
Declaration
C#Copypublic void StartCapture(int count, int interval, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | The number of still images. |
Int32 | interval | The interval of the capture(milliseconds). |
System.Threading.CancellationToken | cancellationToken | The cancellation token to cancel capturing. |
Remarks
If this is not supported, zero shutter lag occurs. The capture resolution could be changed to the preview resolution. This function causes the transition of the camera state from capturing to captured automatically and the corresponding Eventhandlers will be invoked. Each captured image will be delivered through Eventhandler set using the Capturing event. The preview should be restarted by calling the StartPreview() method after capture is completed.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | In case of invalid parameters. |
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
See Also
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
Declaration
C#Copypublic void StartFaceDetection()
Remarks
This should be called after StartPreview() is started. The Eventhandler set using FaceDetected is invoked when the face is detected in the preview frame. Internally, it starts continuously focus and focusing on the detected face.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
StartFocusing(Boolean)
Starts camera auto-focusing, asynchronously. The camera must be in the Preview or the Captured state.
Declaration
C#Copypublic void StartFocusing(bool continuous)
Parameters
Type | Name | Description |
---|---|---|
Boolean | continuous | Continuous auto focus. |
Remarks
If continuous status is true, the camera continuously tries to focus.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of invalid parameters. |
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
StartPreview()
Starts capturing and drawing preview frames on the screen. The display property must be set using Display before using this method. If needed set fps PreviewFps, preview resolution PreviewResolution, or preview format PreviewPixelFormat before using this method. The camera must be in the Created or the Captured state.
Declaration
C#Copypublic void StartPreview()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
Declaration
C#Copypublic void StopFaceDetection()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
StopFocusing()
Stops camera auto focusing. The camera must be in the Preview or the Captured state.
Declaration
C#Copypublic void StopFocusing()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
StopPreview()
Stops capturing and drawing preview frames on the screen. The camera must be in the Preview state.
Declaration
C#Copypublic void StopPreview()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
ObjectDisposedException | The camera has already been disposed. |
UnauthorizedAccessException | In case of access to the resources cannot be granted. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/camera
Feature: http://tizen.org/feature/camera
Events
Declaration
C#Copypublic event EventHandler<EventArgs> CaptureCompleted
Event Type
Type | Description |
---|---|
System.EventHandler<EventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<CameraCapturingEventArgs> Capturing
Event Type
Type | Description |
---|---|
System.EventHandler<CameraCapturingEventArgs> |
API Level: 3
Declaration
C#Copypublic static event EventHandler<CameraDeviceStateChangedEventArgs> DeviceStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<CameraDeviceStateChangedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | In case of any invalid operations. |
System.NotSupportedException | In case of this feature is not supported. |
System.ArgumentException | In case of invalid parameters. |
API Level: 3
Declaration
C#Copypublic event EventHandler<CameraErrorOccurredEventArgs> ErrorOccurred
Event Type
Type | Description |
---|---|
System.EventHandler<CameraErrorOccurredEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<ExtraPreviewEventArgs> ExtraPreview
Event Type
Type | Description |
---|---|
System.EventHandler<ExtraPreviewEventArgs> |
API Level: 10
Declaration
C#Copypublic event EventHandler<FaceDetectedEventArgs> FaceDetected
Event Type
Type | Description |
---|---|
System.EventHandler<FaceDetectedEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<CameraFocusStateChangedEventArgs> FocusStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<CameraFocusStateChangedEventArgs> |
API Level: 3
HdrCaptureProgress
An event that occurs when there is a change in the HDR capture progress. Checks whether the IsHdrCaptureSupported is supported or not before adding this EventHandler.
Declaration
C#Copypublic event EventHandler<HdrCaptureProgressEventArgs> HdrCaptureProgress
Event Type
Type | Description |
---|---|
System.EventHandler<HdrCaptureProgressEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | In case of HDR feature is not supported. |
API Level: 3
Declaration
C#Copypublic event EventHandler<CameraInterruptedEventArgs> Interrupted
Event Type
Type | Description |
---|---|
System.EventHandler<CameraInterruptedEventArgs> |
API Level: 3
InterruptStarted
An event that occurs when the camera interrupt is started by the policy.
Declaration
C#Copypublic event EventHandler<CameraInterruptStartedEventArgs> InterruptStarted
Event Type
Type | Description |
---|---|
System.EventHandler<CameraInterruptStartedEventArgs> |
API Level: 4
MediaPacketPreview
An event that occurs once per frame when previewing. Preview callback is registered when an user adds a callback explicitly to avoid useless P/Invoke.
Declaration
C#Copypublic event EventHandler<MediaPacketPreviewEventArgs> MediaPacketPreview
Event Type
Type | Description |
---|---|
System.EventHandler<MediaPacketPreviewEventArgs> |
API Level: 3
Preview
An event that occurs once per frame when previewing. Preview callback is registered when an user adds a callback explicitly to avoid useless P/Invoke.
Declaration
C#Copypublic event EventHandler<PreviewEventArgs> Preview
Event Type
Type | Description |
---|---|
System.EventHandler<PreviewEventArgs> |
API Level: 3
Declaration
C#Copypublic event EventHandler<CameraStateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<CameraStateChangedEventArgs> |