Skip to content

Commit

Permalink
添加项目文件。
Browse files Browse the repository at this point in the history
  • Loading branch information
Weaxs committed Jun 10, 2020
1 parent b140639 commit 50d7c06
Show file tree
Hide file tree
Showing 18 changed files with 1,384 additions and 0 deletions.
25 changes: 25 additions & 0 deletions VideoUpsampling_WPF.sln
Original file line number Diff line number Diff line change
@@ -0,0 1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoUpsampling_WPF", "VideoUpsampling_WPF\VideoUpsampling_WPF.csproj", "{00121D18-0EBF-402E-A8E0-4D6D095FA4DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{00121D18-0EBF-402E-A8E0-4D6D095FA4DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00121D18-0EBF-402E-A8E0-4D6D095FA4DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00121D18-0EBF-402E-A8E0-4D6D095FA4DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00121D18-0EBF-402E-A8E0-4D6D095FA4DF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {63278D1D-BCE9-4CD0-8D6E-DA13FA84F8A4}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions VideoUpsampling_WPF/App.config
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
18 changes: 18 additions & 0 deletions VideoUpsampling_WPF/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 1,18 @@
<Application x:Class="WpfApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<!-- Accent and AppTheme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions VideoUpsampling_WPF/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace VideoUpsampling_WPF
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
}
}
162 changes: 162 additions & 0 deletions VideoUpsampling_WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 1,162 @@
<controls:MetroWindow x:Class="VideoUpsampling_WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VideoUpsampling_WPF"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
mc:Ignorable="d"
Title="采样工具箱" Icon="icon.ico" Height="567.969" Width="468" ResizeMode="NoResize" BorderBrush="DarkGray" Background="White" WindowTitleBrush="DarkGray">

<Window.Resources>
<Style x:Key="CheckRadioFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="14,0,0,0" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SliderCheckBox" TargetType="{x:Type CheckBox}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<ControlTemplate.Resources>
<Storyboard x:Key="StoryboardIsChecked">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="CheckFlag">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="14"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="StoryboardIsCheckedOff">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="CheckFlag">
<EasingDoubleKeyFrame KeyTime="0" Value="14"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<BulletDecorator Background="Transparent" SnapsToDevicePixels="true">
<BulletDecorator.Bullet>
<Border x:Name="ForegroundPanel" BorderThickness="1" Width="35" Height="20" CornerRadius="10">
<Canvas>
<Border Background="White" x:Name="CheckFlag" CornerRadius="10" VerticalAlignment="Center" BorderThickness="1" Width="19" Height="18" RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Border.RenderTransform>
<Border.Effect>
<DropShadowEffect ShadowDepth="1" Direction="180" />
</Border.Effect>
</Border>
</Canvas>
</Border>
</BulletDecorator.Bullet>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="HasContent" Value="true">
<Setter Property="FocusVisualStyle" Value="{StaticResource CheckRadioFocusVisual}"/>
<Setter Property="Padding" Value="4,0,0,0"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<!--<Setter TargetName="ForegroundPanel" Property="Background" Value="{DynamicResource Accent}" />-->
<Setter TargetName="ForegroundPanel" Property="Background" Value="Green" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="BeginStoryboardCheckedTrue" Storyboard="{StaticResource StoryboardIsChecked}" />
<RemoveStoryboard BeginStoryboardName="BeginStoryboardCheckedFalse" />
</Trigger.EnterActions>
</Trigger>
<Trigger Property="IsChecked" Value="False">
<Setter TargetName="ForegroundPanel" Property="Background" Value="Gray" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="BeginStoryboardCheckedFalse" Storyboard="{StaticResource StoryboardIsCheckedOff}" />
<RemoveStoryboard BeginStoryboardName="BeginStoryboardCheckedTrue" />
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>

<Grid Margin="0,0,-20,0" Height="415" VerticalAlignment="Top" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="43*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="importButton" FontFamily="微软雅黑" FontStyle="Normal" FontSize="12" Click="importButton_Click" Content="视频" HorizontalAlignment="Left" Margin="340,36,0,0" VerticalAlignment="Top" Width="75" Height="29"/>
<TextBox Name="importTextBox" AllowDrop="True" PreviewDragOver="importTextBox_PreviewDragOver" PreviewDrop="importTextBox_PreviewDrop" HorizontalAlignment="Left" Height="23" Margin="54,36,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="244">
<TextBox.Resources>
<VisualBrush x:Key="HelpBrush" TileMode="None" Opacity="0.5" Stretch="None" AlignmentX="Left">
<VisualBrush.Visual>
<TextBlock Name="waterText" Text="请输入原视频地址"/>
</VisualBrush.Visual>
</VisualBrush>
</TextBox.Resources>
<TextBox.Style>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="Text" Value="{x:Null}">
<Setter Property="Background" Value="{StaticResource HelpBrush}"/>
</Trigger>
<Trigger Property="Text" Value="">
<Setter Property="Background" Value="{StaticResource HelpBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>

<TextBox Name="exportTextBox" HorizontalAlignment="Left" Height="23" Margin="54,87,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="244">
</TextBox>
<Button Name="exportButton" FontFamily="微软雅黑" FontStyle="Normal" FontSize="12" Click="exportButton_Click" Content="输出" HorizontalAlignment="Left" Margin="340,87,0,0" VerticalAlignment="Top" Width="75" Height="28"/>
<Button Name="compareButton" FontFamily="微软雅黑" FontStyle="Normal" FontSize="12" Click="compareButton_Click" Content="画面对比" HorizontalAlignment="Left" Margin="265,136,0,0" VerticalAlignment="Top" Width="150" Height="29"/>
<Button Name="upsampleButton" FontFamily="微软雅黑" FontStyle="Normal" FontSize="12" Click="upsampleButton_Click" Content="上采样" HorizontalAlignment="Left" Margin="54,136,0,0" VerticalAlignment="Top" Width="150" Height="29"/>
<TextBlock HorizontalAlignment="Left" FontSize="15px" Margin="301,181,0,0" TextWrapping="Wrap" Text="视频分辨率" VerticalAlignment="Top" Height="24" Width="80"/>
<RadioButton Content="720x480" HorizontalAlignment="Left" Margin="301,222,0,0" VerticalAlignment="Top" Height="23" Width="90" Checked="Checked480"/>
<RadioButton Content="1280x720" HorizontalAlignment="Left" Margin="301,262,0,0" VerticalAlignment="Top" Height="23" Width="90" Checked="Checked720"/>
<RadioButton Content="1920x1080" HorizontalAlignment="Left" Margin="301,301,0,0" VerticalAlignment="Top" Height="24" Width="90" Checked="Checked1080"/>
<Grid HorizontalAlignment="Left" Height="304" Margin="30,222,0,-278" VerticalAlignment="Top" Width="206">
<Label Content="算法选择" FontSize="15px" HorizontalAlignment="Left" Margin="61,-49,0,0" VerticalAlignment="Top" Height="27" Width="81" RenderTransformOrigin="0.351,1.104"/>
<RadioButton Content="nnedi3算法" FontSize="12" HorizontalAlignment="Left" Margin="61,80,0,0" VerticalAlignment="Top" Checked="Nnedi_Checked"/>
<RadioButton Content="S-Spline算法" FontSize="12px" HorizontalAlignment="Left" Margin="61,121,0,0" VerticalAlignment="Top" Checked="Spline_Checked"/>
<RadioButton Content="Bilinear算法" HorizontalAlignment="Left" Margin="61,0,0,0" VerticalAlignment="Top" Checked="Bilinear_Checked"/>
<RadioButton Content="Bicubic算法" HorizontalAlignment="Left" Margin="61,40,0,0" VerticalAlignment="Top" Checked="Bicubic_Cheched"/>

</Grid>

<Grid x:Name="Grid" >

<!--还是上一话题,我只需要右侧纵向的滚动条,横向滚动条和多余的代码我都去掉了,如果横竖都要用,请照葫芦画瓢,就当是复习了-->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<!--ScrollViewer左侧内容模版,对它没什么特别的操作,默认就可以-->
<TextBox x:Name="Result" TextWrapping="Wrap" Grid.Column="0" Margin="32,415,50,-110" Grid.Row="0"
VerticalScrollBarVisibility="Auto"/>
<CheckBox x:Name="IsUesd" Style="{DynamicResource SliderCheckBox}" Content="启用降噪、锐化等滤镜" HorizontalAlignment="Left" Margin="265,340,0,0" VerticalAlignment="Top" Height="28" Width="164"/>


</Grid>


<StackPanel Margin="0,396,0,0">
<ProgressBar Name="pb" Height="21" Foreground="Purple" Background="LightGray" Margin="32,0,50,0"/>
</StackPanel>
<TextBlock Text="" Foreground="Blue" Name="tbmsg" HorizontalAlignment="Left" Margin="30,380,0,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
</Grid>
</controls:MetroWindow>
Loading

0 comments on commit 50d7c06

Please sign in to comment.