<Window x:Class="WPF_Quick_Start_Demo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="633" Width="949"  Background="DarkGray">

    <Grid Height="541">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="248*" />
            <ColumnDefinition Width="608*"/>
            <ColumnDefinition Width="47*"/>
            <ColumnDefinition Width="39*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="109*" />
            <RowDefinition Height="432*" />
        </Grid.RowDefinitions>

        <Border BorderBrush="Black" BorderThickness="1" Grid.ColumnSpan="3" HorizontalAlignment="Left" Height="114" Margin="492.4,0,0,0" VerticalAlignment="Top" Width="182" Grid.RowSpan="2" Grid.Column="1">
            <Button x:Name="StopRecording" Content="Stop recording" HorizontalAlignment="Left" Width="98" IsEnabled="False" Margin="9,83,0,4" Click="StopRecording_Click"/>
        </Border>

        <Button Content="start preview (e.g. screen capture)" x:Name="StartPreview" HorizontalAlignment="Left" Width="199" Click="StartPreview_Screen_Click" Height="26" VerticalAlignment="Top" Margin="12,0,0,0"/>

        <Image Height="350" Margin="20,82.2,0,-0.2" x:Name="image1" Stretch="None" VerticalAlignment="Top" Grid.Row="1" StretchDirection="Both" HorizontalAlignment="Left" Width="635" Grid.ColumnSpan="2" AllowDrop="True" />
        <Button Content="stop preview" Margin="174.4,0,0,0" x:Name="StopPreview" Click="StopPreview_Click" Height="26" HorizontalAlignment="Left" VerticalAlignment="Top" Width="94" Grid.Column="1" />
        <Button Margin="198,67,0,0" x:Name="ReactivateWPFRendering" Height="26" VerticalAlignment="Top" Click="ReactivateWPFRendering_Click" HorizontalAlignment="Left" Width="143" Content="reactivate WPF rendering" Grid.Column="1"/>
        <Button HorizontalAlignment="Right" Margin="0,66,415,0" x:Name="DeactivateWPFRendering" Width="216" Click="DeactivateWPFRendering_Click" Height="26" VerticalAlignment="Top" Content="deactivate WPF rendering (saves cpu)" Grid.ColumnSpan="2"/>
        <Button HorizontalAlignment="Left" Margin="364,67,0,0" x:Name="OneShot" Width="114" Height="26" VerticalAlignment="Top" Click="OneShot_Click" Content="One shot capture" Grid.Column="1"/>
        <Button HorizontalAlignment="Left" x:Name="OpenClip" Width="91" Height="26" VerticalAlignment="Top" Click="OpenClip_Click" Margin="299.4,0,0,0" Content="open clip..." Grid.Column="1"/>
        <Button HorizontalAlignment="Left" Margin="396.4,0,0,0" x:Name="CloseClip" Width="91" Height="26" VerticalAlignment="Top" Click="CloseClip_Click" Content="close clip" Grid.Column="1"/>
        <Image Grid.Row="1" Height="162" HorizontalAlignment="Left" Margin="458,270.2,0,-0.2" x:Name="image2" Stretch="None" VerticalAlignment="Top" StretchDirection="Both" Width="210" Grid.ColumnSpan="3" Grid.Column="1" />
        <Button Content="start preview (e.g. webcam)" Height="26" HorizontalAlignment="Left" Margin="217,0,0,0" x:Name="StartPreview_Webcam" VerticalAlignment="Top" Width="199" Click="StartPreview_Webcam_Click" Grid.ColumnSpan="2" />
        <Button Content="open URL:" x:Name="OpenURL" HorizontalAlignment="Left" Width="80" Height="26" VerticalAlignment="Top" Margin="12,31,0,0" Click="OpenURL_Click"/>
        <TextBox HorizontalAlignment="Left" Height="26" Margin="128,0,0,51.8" x:Name="RtspURL" TextWrapping="Wrap" Text="Enter the RTSP URL here, e.g.: rtsp://..., rtmp://..., http://..., etc" VerticalAlignment="Bottom" Width="607" Grid.ColumnSpan="2"/>
        <Button x:Name="OpenURLInfo" Content="?" HorizontalAlignment="Left" Height="26" Margin="97,31,0,0" VerticalAlignment="Top" Width="26" Click="OpenURLInfo_Click"/>
        <CheckBox x:Name="TextOverlays" Content="text overlays" HorizontalAlignment="Left" Height="16" Margin="20,88,0,0" VerticalAlignment="Top" Width="100" Checked="TextOverlays_Checked"/>
        <CheckBox x:Name="LineOverlay" Content="line overlay" HorizontalAlignment="Left" Margin="125,88,0,0" Width="100" Checked="LineOverlay_Checked" Height="16" VerticalAlignment="Top" Unchecked="LineOverlay_Unchecked"/>
        <CheckBox x:Name="RecordIPCameraToMP4" Content="Record IP Camera to MP4" HorizontalAlignment="Left" Height="26" Margin="500.4,8,0,0" VerticalAlignment="Top" Width="158" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="3" Grid.Column="1">
            <CheckBox.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform AngleX="3.066"/>
                    <RotateTransform/>
                    <TranslateTransform X="0.696"/>
                </TransformGroup>
            </CheckBox.RenderTransform>
        </CheckBox>
        <Button x:Name="NewFileWhileRecording" Content="new file while recording" HorizontalAlignment="Left" Height="24" Margin="501.4,26,0,0" VerticalAlignment="Top" Width="153" IsEnabled="False" Click="NewFileWhileRecording_Click" Grid.ColumnSpan="2" Grid.Column="1"/>
        <Button x:Name="PauseRecording" Content="pause rec." HorizontalAlignment="Left" Height="19" Margin="501.4,57,0,0" VerticalAlignment="Top" Width="82" Click="PauseRecording_Click" IsEnabled="False" Grid.Column="1"/>
        <Button x:Name="ResumeRecording" Content="resume rec." HorizontalAlignment="Left" Height="19" Margin="588.4,57,0,0" VerticalAlignment="Top" Width="80" RenderTransformOrigin="0.848,0.816" Click="ResumeRecording_Click" IsEnabled="False" Grid.ColumnSpan="3" Grid.Column="1"/>
        <GroupBox x:Name="groupBox" Grid.ColumnSpan="2" Header="External Rendering (must be enabled before starting the video)" HorizontalAlignment="Left" Height="46" Margin="10,1.2,0,0" VerticalAlignment="Top" Width="365" Grid.Row="1" RenderTransformOrigin="0.851,3.05">
            <Grid HorizontalAlignment="Left" Height="26" Margin="0,0,0,-2" VerticalAlignment="Top" Width="559">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90*"/>
                    <ColumnDefinition Width="469*"/>
                    <ColumnDefinition Width="0*"/>
                </Grid.ColumnDefinitions>
                <CheckBox x:Name="chkFullScreen" Content="full screen" HorizontalAlignment="Left" Height="16" Margin="177.6,8,0,0" VerticalAlignment="Top" Width="90" Checked="chkFullScreen_Checked" Unchecked="chkFullScreen_Unchecked" RenderTransformOrigin="0.04,0.488" Grid.Column="1"/>
                <CheckBox x:Name="chkExternalWindow" Content="external window" HorizontalAlignment="Left" Margin="61.6,8,0,0" Width="111" Checked="chkExternalWindow_Checked" Unchecked="chkExternalWindow_Unchecked" Height="16" VerticalAlignment="Top" Grid.Column="1"/>
                <RadioButton x:Name="rdgExtRenderDisabled" GroupName="rdgExtRender" Content="DISABLED" IsChecked="True" HorizontalAlignment="Left" Height="18" VerticalAlignment="Top" Width="74" Margin="0,8,0,0" Checked="rdgExtRenderDisabled_Checked"/>
                <RadioButton x:Name="rdgExtRenderEnabledWpf" GroupName="rdgExtRender" Content="ENABLED"  HorizontalAlignment="Left" Height="18" Margin="74,8,0,0" VerticalAlignment="Top" Width="69" Checked="rdgExtRenderEnabledWpf_Checked" Grid.ColumnSpan="2"/>
            </Grid>
        </GroupBox>
        <TextBox x:Name="Logbox" Grid.ColumnSpan="3" Grid.Column="1" HorizontalAlignment="Left" Height="230" Margin="458,20.2,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="216"/>
        <CheckBox x:Name="chkWithAudio" Content="with audio" HorizontalAlignment="Left" Height="14" Margin="12,62,0,0" VerticalAlignment="Top" Width="80" Checked="chkWithAudio_Checked"/>
    </Grid>
</Window>
