|
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cam="clr-namespace:WebcamControl;assembly=WebcamControl"
Title="WPF Webcam" Height="495" Width="353">
<Window.Resources>
<DataTemplate x:Key="DevicesListTemplate">
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="207"/>
</Grid.RowDefinitions>
<cam:Webcam Name="WebcamCtrl" Margin="10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<StackPanel Margin="0,5,0,0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="1">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="22">
<TextBlock Height="22" Width="78" HorizontalAlignment="Left" VerticalAlignment="Top"
Text="Video Device" TextAlignment="Left" FlowDirection="LeftToRight" />
<ComboBox Height="22" Width="210" HorizontalAlignment="Left" VerticalAlignment="Top"
x:Name="VideoDevicesComboBox" ItemTemplate="{StaticResource DevicesListTemplate}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="23" Margin="0,10,0,0">
<TextBlock Height="22" Width="78" HorizontalAlignment="Left" VerticalAlignment="Top"
Text="Audio Device" TextAlignment="Left" FlowDirection="LeftToRight"/>
<ComboBox HorizontalAlignment="Left" Height="23" Width="210" VerticalAlignment="Bottom"
x:Name="AudioDevicesComboBox" ItemTemplate="{StaticResource DevicesListTemplate}"/>
</StackPanel>
</StackPanel>
<Grid Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.Row="1">
<Button Content="Start Recording" Height="24" Width="115" Margin="0,40,0,0" HorizontalAlignment="Left"
VerticalAlignment="Top" x:Name="StartRecordingButton" Click="StartRecordingButton_Click"/>
<Button Content="Stop Recording" Height="24" Width="112" Margin="0,40,0,0" HorizontalAlignment="Right"
VerticalAlignment="Top" x:Name="StopRecordingButton" Click="StopRecordingButton_Click"/>
<Button Content="Stop Capture" Height="24" Width="112" HorizontalAlignment="Right"
VerticalAlignment="Top" x:Name="StopCaptureButton" Click="StopCaptureButton_Click"/>
<Button Content="Start Capture" Height="24" Width="115" HorizontalAlignment="Left"
VerticalAlignment="Top" x:Name="StartCaptureButton" Click="StartCaptureButton_Click"/>
<Button Content="Take Snapshot" Height="24" Width="120" Margin="60,78,60,0" HorizontalAlignment="Center"
VerticalAlignment="Top" x:Name="TakeSnapshotButton" Click="TakeSnapshotButton_Click"/>
</Grid>
</Grid>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.