C# Class Mvvm.Services.CameraService

Datei anzeigen Open project: XamlBrewer/UWP-ImageCropper- Class Usage Examples

Private Properties

Property Type Description
CleanupCameraAsync System.Threading.Tasks.Task
ConvertDisplayOrientationToDegrees int
FindCameraDeviceByPanelAsync Task
InitializeCameraAsync System.Threading.Tasks.Task
MediaCapture_Failed void
SetPreviewRotationAsync System.Threading.Tasks.Task
StartPreviewAsync Task
StopPreviewAsync Task

Public Methods

Method Description
CameraService ( CaptureElement el ) : System

Private Methods

Method Description
CleanupCameraAsync ( ) : System.Threading.Tasks.Task

Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events

ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) : int

Converts the given orientation of the app on the screen to the corresponding rotation in degrees

FindCameraDeviceByPanelAsync ( Windows desiredPanel ) : Task

Queries the available video capture devices to try and find one mounted on the desired panel

InitializeCameraAsync ( ) : System.Threading.Tasks.Task
MediaCapture_Failed ( MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs ) : void
SetPreviewRotationAsync ( ) : System.Threading.Tasks.Task

Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview

StartPreviewAsync ( ) : Task

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI

StopPreviewAsync ( ) : Task

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI

Method Details

CameraService() public method

public CameraService ( CaptureElement el ) : System
el Windows.UI.Xaml.Controls.CaptureElement
return System