Projekt-Anfragen: Tel: 07022/9319004 info@CodeDocu.de Software Entwicklung in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

Win10 Samples: CameraStarterKit
 
Quelle: GitHub->Windows 10 Universal Samples
Das Sample besteht im wesentlichen aus er Mainpage mit dem Video-Kamera CaptureElement und zwei Buttons

 
XAML Sample


<!--Camera preview-->
<CaptureElement Name="PreviewControl" Stretch="Uniform"/>

<!-- Capture + Record buttons -->
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Center">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Margin" Value="10,40"/>
<Setter Property="MinWidth" Value="80"/>
<Setter Property="MinHeight" Value="80"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="{StaticResource TranslucentBlackBrush}"/>
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
</Style>
</StackPanel.Resources>
 
<Button Name="PhotoButton" Tapped="PhotoButton_Tapped" IsEnabled="False">
<Viewbox MaxHeight="40" MaxWidth="40">
<SymbolIcon Symbol="Camera"/>
</Viewbox>
</Button>
 
<Button Name="VideoButton" Tapped="VideoButton_Tapped" IsEnabled="False">
<Grid>
<Ellipse x:Name="StartRecordingIcon" Fill="Red" Width="20" Height="20"/>
<Rectangle x:Name="StopRecordingIcon" Fill="White" Width="20" Height="20" Visibility="Collapsed"/>
</Grid>
</Button>

 
 
Beim Öffnen der Seite wird zunächst eine Webcam, Kamera gesucht und im bedarfsfall initialisiert
await _mediaCapture.InitializeAsync(settings);

 
Und wenn eine Kamera gefunden wurde, dann wird diese in das PreviewControl zugewiesen
PreviewControl.Source = _mediaCapture;
 
<CaptureElement Name="PreviewControl" Stretch="Uniform"/>

 
 
Quelle:
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraStarterKit
Basic camera app sample
This sample applies an end-to-end approach to demonstrate how to write a camera application using the Windows.Media.Capture API in conjunction with orientation sensors to cover the functions that most camera apps will require.
Specifically, this sample will cover how to:
  1. Manage the MediaCapture object throughout the lifecycle of the app and through navigation events.
  2. Acquire a camera located on a specific side of the device. In this case, the sample attempts to get the rear camera.
  3. Start and stop the preview to a UI element, including mirroring for front-facing cameras.
  4. Take a picture to a file, and disable the video capture button if the app is running on a device that doesn't support concurrent capturing of photos and video.
  5. Record a video to a file, and disable the photo capture button if the app is running on a device that doesn't support concurrent capturing of photos and video.
  6. Handle rotation events for both, the device moving in space and the page orientation changing on the screen. Also apply any necessary corrections to the preview stream rotation and to captured photos and videos.
  7. Handle MediaCapture RecordLimitationExceeded and Failed events to be notified that video recording needs to be stopped due to a video being too long, or clean up the MediaCapture instance when an error occurs.

 
 
Mobile
»
UWP: Hintergrund von Windows 10 Desktop ändern
»
UWP Sample: ContextMenu als XAML Flyout in Page Resources
»
UWP Sample: Context-Menu PopupMenu
»
UWP Sample: MediaEditing Bearbeiten von Videos
»
UWP Beispiel: Drawing Lines Ink
»
UWP Beispiel: Simple Imaging, Images Pictures
»
Win10 Sample: Title bar sample
»
Face Detection Sample #Win10
»
Win10 Sample: CameraGetPreviewFrame
»
Win10 Samples: CameraResolution Video and Photo

.

Jobs, Projekte, Angebote für Freiberufler, Selbstständig an Info@CodeDocu.de