248 lines
16 KiB
XML
248 lines
16 KiB
XML
<Window x:Class="AffdexMe.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
Title="AffdexMe"
|
|
Height="640" Width="480"
|
|
MinHeight="640" MinWidth="480"
|
|
MaxHeight="640" MaxWidth="480"
|
|
ResizeMode="NoResize"
|
|
Loaded="Window_Loaded"
|
|
Closing="Window_Closing">
|
|
|
|
|
|
<Window.Resources>
|
|
<Style TargetType="{x:Type ButtonBase}" x:Key="CustomButtonStyle">
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="Background">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#FF2778BB" Offset="0.51"/>
|
|
<GradientStop Color="#FF2683C5" Offset="0.484"/>
|
|
<GradientStop Color="#FF8CD4FF" Offset="1"/>
|
|
<GradientStop Color="#FF1973AE" Offset="0.497"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Setter Property="BorderBrush" Value="#FF2B5F91"/>
|
|
<Setter Property="Margin" Value="1"/>
|
|
<Setter Property="Height" Value="30"/>
|
|
<Setter Property="MinWidth" Value="20"/>
|
|
<Setter Property="FontSize" Value="13"/>
|
|
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Grid>
|
|
<Rectangle Stroke="{TemplateBinding BorderBrush}" RadiusX="15" RadiusY="15" Fill="{TemplateBinding Background}"/>
|
|
<Rectangle VerticalAlignment="Top" Height="10" Margin="7,2,7,1" RadiusX="10" RadiusY="10">
|
|
<Rectangle.Fill>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#11FFFFFF" Offset="1"/>
|
|
<GradientStop Color="#B2FFFFFF" Offset="0"/>
|
|
</LinearGradientBrush>
|
|
</Rectangle.Fill>
|
|
</Rectangle>
|
|
<Rectangle x:Name="rectangle" RadiusX="15" RadiusY="15" Fill="White" Margin="1" Opacity="0"/>
|
|
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" Margin="{TemplateBinding Padding}"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Opacity" TargetName="rectangle" Value="0.2"/>
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter Property="Opacity" TargetName="rectangle" Value="0.3"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Fill" TargetName="rectangle" Value="#666"/>
|
|
<Setter Property="Opacity" TargetName="rectangle" Value="0.6"/>
|
|
<Setter Property="Opacity" TargetName="contentPresenter" Value="0.3"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="{x:Type ButtonBase}" x:Key="PointsOnButtonStyle">
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="Background">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#FF3CB371" Offset="0.51"/>
|
|
<GradientStop Color="#FF3CB371" Offset="0.484"/>
|
|
<GradientStop Color="#FF3CB371" Offset="1"/>
|
|
<GradientStop Color="#FF1973AE" Offset="0.497"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Setter Property="BorderBrush" Value="#FF2B5F91"/>
|
|
<Setter Property="Margin" Value="1"/>
|
|
<Setter Property="Height" Value="30"/>
|
|
<Setter Property="MinWidth" Value="20"/>
|
|
<Setter Property="FontSize" Value="13"/>
|
|
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Grid>
|
|
<Rectangle Stroke="{TemplateBinding BorderBrush}" RadiusX="15" RadiusY="15" Fill="{TemplateBinding Background}"/>
|
|
<Rectangle VerticalAlignment="Top" Height="10" Margin="7,2,7,1" RadiusX="10" RadiusY="10">
|
|
<Rectangle.Fill>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#11FFFFFF" Offset="1"/>
|
|
<GradientStop Color="#B2FFFFFF" Offset="0"/>
|
|
</LinearGradientBrush>
|
|
</Rectangle.Fill>
|
|
</Rectangle>
|
|
<Rectangle x:Name="rectangle" RadiusX="15" RadiusY="15" Fill="White" Margin="1" Opacity="0"/>
|
|
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" Margin="{TemplateBinding Padding}"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Opacity" TargetName="rectangle" Value="0.2"/>
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter Property="Opacity" TargetName="rectangle" Value="0.3"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Fill" TargetName="rectangle" Value="#666"/>
|
|
<Setter Property="Opacity" TargetName="rectangle" Value="0.6"/>
|
|
<Setter Property="Opacity" TargetName="contentPresenter" Value="0.3"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
</Window.Resources>
|
|
|
|
<Grid Name="gridMainDisplay" Margin="0,0,0,0" >
|
|
|
|
<Grid Name="gridContentDisplay" DockPanel.Dock="Top">
|
|
|
|
|
|
<StackPanel Name="stackPanelImage" Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
|
|
|
<Grid Name="gridAffdexFaceDisplay" VerticalAlignment="Stretch" Width="auto" Height="560" >
|
|
|
|
<Image Name="imgAffdexFaceDisplay" Visibility="Hidden" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="UniformToFill"/>
|
|
|
|
<Image Name="imgAffdexLogoDisplay" Margin="40" Width="auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
Height="auto" Source="Resources/AffectivaLogo1.png" Visibility="Visible"/>
|
|
|
|
<Canvas Name="canvasFacePoints" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<StackPanel Name="stackPanelClassifiersBackground" Orientation="Vertical" Background="Gainsboro" Height="130" HorizontalAlignment="Stretch" VerticalAlignment="Top" Opacity=".3" />
|
|
|
|
|
|
<StackPanel Name="stackPanelClassifiers" Orientation="Vertical" Background="Transparent" Height="130" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
|
|
|
|
<Grid Name="gridClassifierDisplay" VerticalAlignment="Stretch" Background="Transparent" Margin="0,5,0,0"
|
|
Width="{Binding ElementName=stackPanelClassifiers, Path=ActualWidth}"
|
|
Height="{Binding ElementName=stackPanelClassifiers, Path=ActualHeight}" >
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="0.36*" />
|
|
<ColumnDefinition Width="0.28*" />
|
|
<ColumnDefinition Width="0.36*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="40" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Orientation="Vertical" Grid.Row="0" Grid.Column="0" Margin="0,0,0,0">
|
|
<TextBlock Name="txtSmileClassifierName" Text="SMILE" Foreground="OrangeRed" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/>
|
|
<Grid>
|
|
<TextBlock Name="txtSmileClassifierValueBackground" Width="50" Background="LimeGreen" HorizontalAlignment="Center"/>
|
|
<TextBlock Name="txtSmileClassifierValue" Width="50" TextAlignment="Center" Text="10%" FontWeight="SemiBold" Foreground="Black" HorizontalAlignment="Center"/>
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Vertical" Grid.Row="0" Grid.Column="2" Margin="0,0,0,0" >
|
|
<TextBlock Name="txtFrownClassifierName" Text="FROWN" Foreground="OrangeRed" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/>
|
|
<Grid>
|
|
<TextBlock Name="txtFrownClassifierValueBackground" Width="50" Background="LimeGreen" HorizontalAlignment="Center" />
|
|
<TextBlock Name="txtFrownClassifierValue" Width="50" TextAlignment="Center" Text="10%" FontWeight="SemiBold" Foreground="Black" HorizontalAlignment="Center" />
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="0" Margin="0,0,0,0" >
|
|
<TextBlock Name="txtBrowRaiseClassifierName" Text="BROW RAISE" Foreground="OrangeRed" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/>
|
|
<Grid>
|
|
<TextBlock Name="txtBrowRaiseClassifierValueBackground" Width="50" Background="LimeGreen" HorizontalAlignment="Center" />
|
|
<TextBlock Name="txtBrowRaiseClassifierValue" Width="50" TextAlignment="Center" Text="10%" FontWeight="SemiBold" Foreground="Black" HorizontalAlignment="Center" />
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="2" Margin="0,0,0,0" >
|
|
<TextBlock Name="txtValenceClassifierName" Text="VALENCE" Foreground="OrangeRed" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/>
|
|
<Grid>
|
|
<TextBlock Name="txtValenceClassifierValueBackground" Width="50" Background="LimeGreen" HorizontalAlignment="Center" />
|
|
<TextBlock Name="txtValenceClassifierValue" Width="50" TextAlignment="Center" Text="10%" FontWeight="SemiBold" Foreground="Black" HorizontalAlignment="Center"/>
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="0" Margin="0,0,0,0" >
|
|
<TextBlock Name="txtBrowLowerClassifierName" Text="BROW FURROW" Foreground="OrangeRed" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/>
|
|
<Grid>
|
|
<TextBlock Name="txtBrowLowerClassifierValueBackground" Width="50" Background="LimeGreen" HorizontalAlignment="Center" />
|
|
<TextBlock Name="txtBrowLowerClassifierValue" Width="50" TextAlignment="Center" Text="10%" FontWeight="SemiBold" Foreground="Black" HorizontalAlignment="Center" />
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="2" Margin="0,0,0,0" >
|
|
<TextBlock Name="txtEngagementClassifierName" Text="ENGAGEMENT" Foreground="OrangeRed" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center" />
|
|
<Grid>
|
|
<TextBlock Name="txtEngagementClassifierValueBackground" Width="50" Background="LimeGreen" HorizontalAlignment="Center" />
|
|
<TextBlock Name="txtEngagementClassifierValue" Width="50" TextAlignment="Center" Text="10%" FontWeight="SemiBold" Foreground="Black" HorizontalAlignment="Center" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<StackPanel Name="stackPanelLogoBackground" Orientation="Vertical" Background="Transparent" Height="75" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
|
|
<Grid Name="gridLogoBackground">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="0.36*" />
|
|
<ColumnDefinition Width="0.28*" />
|
|
<ColumnDefinition Width="0.36*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="20" />
|
|
<RowDefinition Height="35" />
|
|
<RowDefinition Height="20" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Image Name="imgAffdexLogoBackground" Width="auto" Grid.Column="1" Grid.Row="1"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
Height="auto" Source="Resources/AffectivaLogo1.png" Margin="0,0,0,-34" Grid.RowSpan="2"/>
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<DockPanel VerticalAlignment="Bottom" Background="Coral" >
|
|
|
|
<Grid HorizontalAlignment="Center">
|
|
<GroupBox Margin="0,5,0,0" Height="40" VerticalAlignment="Stretch" BorderBrush="Transparent" BorderThickness="0">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Button Name="btnStartCamera" Style="{StaticResource CustomButtonStyle}" HorizontalAlignment="Center" Margin="0,0,5,0" VerticalAlignment="Top" Width="55" Content="Start" />
|
|
<Button Name="btnResetCamera" Style="{StaticResource CustomButtonStyle}" HorizontalAlignment="Center" Margin="0,0,5,0" VerticalAlignment="Top" Width="56" Content="Reset" />
|
|
<Button Name="btnShowPoints" Style="{StaticResource CustomButtonStyle}" HorizontalAlignment="Center" Margin="0,0,5,0" VerticalAlignment="Top" Width="80" Content="Show Points" />
|
|
<Button Name="btnStopCamera" Style="{StaticResource CustomButtonStyle}" HorizontalAlignment="Center" Margin="0,0,5,0" VerticalAlignment="Top" Width="55" Content="Stop" />
|
|
<Button Name="btnExit" Style="{StaticResource CustomButtonStyle}" HorizontalAlignment="Center" Margin="0,0,5,0" VerticalAlignment="Bottom" Width="55" Content="Exit" />
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</Grid>
|
|
</DockPanel>
|
|
</Grid>
|
|
</Window>
|