Skip to content

Commit

Permalink
V4.0 Watermark (#2)
Browse files Browse the repository at this point in the history
* Skia

* v4.0 Watermark
  • Loading branch information
kingsznhone authored Apr 11, 2022
1 parent 9242875 commit 1a206db
Show file tree
Hide file tree
Showing 27 changed files with 327 additions and 72 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CA1416: 验证平台兼容性
dotnet_diagnostic.CA1416.severity = none
5 changes: 5 additions & 0 deletions Electrical Weathering.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Electrical Weathering", "Electrical Weathering\Electrical Weathering.csproj", "{8A23BF79-FD70-4942-85F3-61839911616F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{78D47EC2-309B-45A8-A103-7E7EAABAA745}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down
Binary file modified Electrical Weathering/AppIcon.ico
Binary file not shown.
Binary file removed Electrical Weathering/Demo.jpg
Binary file not shown.
42 changes: 29 additions & 13 deletions Electrical Weathering/Electrical Weathering.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<VersionPrefix>4.0.0.0</VersionPrefix>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>3.0.0.%2a</ApplicationVersion>
<ApplicationVersion>4.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand Down Expand Up @@ -42,6 +43,7 @@
<AssemblyVersion></AssemblyVersion>
<FileVersion></FileVersion>
<NeutralLanguage>zh-CN</NeutralLanguage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
Expand All @@ -52,15 +54,23 @@
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<ItemGroup>
<None Remove="ImageResources\Demo6.jpg" />
<None Remove="ImageResources\Demo7.jpg" />
<None Remove="ImageResources\Demo8.jpg" />
<None Remove="Resources\Demo6.jpg" />
<None Remove="Resources\Demo7.jpg" />
<None Remove="Resources\Demo8.jpg" />
<None Remove="Resources\Watermark_Tieba.png" />
<None Remove="Resources\Watermark_Toutiao.png" />
<None Remove="Resources\Watermark_Weibo.png" />
<None Remove="Resources\Watermark_Zhihu.png" />
<None Remove="Weathering.bmp" />
</ItemGroup>
<ItemGroup>
<Resource Include="Demo.jpg" />
<Resource Include="ImageResources\Demo6.jpg" />
<Resource Include="ImageResources\Demo7.jpg" />
<Resource Include="ImageResources\Demo8.jpg" />
<Resource Include="Resources\Demo6.jpg" />
<Resource Include="Resources\Demo7.jpg" />
<Resource Include="Resources\Demo8.jpg" />
<Resource Include="Resources\Watermark_Tieba.png" />
<Resource Include="Resources\Watermark_Toutiao.png" />
<Resource Include="Resources\Watermark_Weibo.png" />
<Resource Include="Resources\Watermark_Zhihu.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Weathering.bmp" />
Expand All @@ -81,19 +91,25 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="ImageResources\Demo2.jpg" />
<Content Include="AppIcon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Demo2.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="ImageResources\Demo1.jpg" />
<Resource Include="Resources\Demo1.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="ImageResources\Demo3.jpg" />
<Resource Include="Resources\Demo3.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="ImageResources\Demo5.jpg" />
<Resource Include="Resources\Demo5.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="ImageResources\Demo4.jpg" />
<Resource Include="Resources\Demo4.jpg" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
Expand Down
44 changes: 24 additions & 20 deletions Electrical Weathering/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,20 @@

<Grid Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>

<Grid Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBox x:Name="FilePathTextBox" Margin="30,50,30,0" TextWrapping="NoWrap" Text="" VerticalAlignment="Top" FontSize="18" TextAlignment="Left" Height="25" Drop="FilePathTextBox_Drop" AllowDrop="True" PreviewDragOver="FilePathTextBox_PreviewDragOver"/>
<Button x:Name="FileSelectBtn" Content="选择文件" Margin="0,100,30,0" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="18" Width="120" Background="#FF005FB8" Foreground="White" Height="30" Click="FileSelectBtn_Click"/>
<Grid Grid.Row="0">
<RadioButton x:Name="ModeClassic" Content="官窑[Skia](慢)" HorizontalAlignment="Left" Margin="50,30,0,0" VerticalAlignment="Top" FontSize="22" Checked="ModeClassic_Checked"/>
<RadioButton x:Name="ModeNG" Content="民窑[OpenCV](快)" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="22" Margin="0,30,50,0" Checked="ModeNG_Checked"/>
</Grid>
<Grid Grid.Row="1">
<Grid Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBox x:Name="FilePathTextBox" Margin="30,10,30,0" TextWrapping="NoWrap" Text="" VerticalAlignment="Top" FontSize="18" TextAlignment="Left" Height="25" Drop="FilePathTextBox_Drop" AllowDrop="True" PreviewDragOver="FilePathTextBox_PreviewDragOver"/>
<Button x:Name="FileSelectBtn" Content="选择文件" Margin="0,50,30,0" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="18" Width="120" Background="#FF005FB8" Foreground="White" Height="30" Click="FileSelectBtn_Click"/>
</Grid>
<Grid Grid.Row="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
Expand All @@ -59,59 +63,58 @@
</Grid.RowDefinitions>

<Grid Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Slider x:Name="Slider_Noise" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" ValueChanged="Slider_Noise_ValueChanged" TickFrequency="0.01" IsSnapToTickEnabled="True" LargeChange="0.01" PreviewMouseLeftButtonDown="Slider_Noise_PreviewMouseLeftButtonDown" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_Noise_PreviewMouseLeftButtonUp" />
<Slider x:Name="Slider_Noise" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" ValueChanged="Slider_Noise_ValueChanged" TickFrequency="0.01" IsSnapToTickEnabled="True" LargeChange="0.01" PreviewMouseLeftButtonDown="Slider_Noise_PreviewMouseLeftButtonDown" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_MouseLeftButtonUp" KeyUp="Slider_KeyUp" />
<TextBlock TextWrapping="Wrap" Text="噪点" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="18" Margin="30,0,0,0"/>
<TextBlock x:Name="TextNoiseValue" TextWrapping="Wrap" Text="0%" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="18" Margin="0,0,30,0"/>

</Grid>
<Grid Grid.Row="1">
<Slider x:Name="Slider_Greening" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" TickFrequency="0.01" IsSnapToTickEnabled="True" ValueChanged="Slider_Greening_ValueChanged" LargeChange="0.01" PreviewMouseLeftButtonDown="Slider_Greening_PreviewMouseLeftButtonDown" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_Noise_PreviewMouseLeftButtonUp" />
<Slider x:Name="Slider_Greening" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" TickFrequency="0.01" IsSnapToTickEnabled="True" ValueChanged="Slider_Greening_ValueChanged" LargeChange="0.01" PreviewMouseLeftButtonDown="Slider_Greening_PreviewMouseLeftButtonDown" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_MouseLeftButtonUp" KeyUp="Slider_KeyUp" />
<TextBlock TextWrapping="Wrap" Text="绿化" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="18" Margin="30,0,0,0"/>
<TextBlock x:Name="TextGreeningValue" TextWrapping="Wrap" Text="0%" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="18" Margin="0,0,30,0"/>
</Grid>
<Grid Grid.Row="2">
<Slider x:Name="Slider_Compressing" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" IsSnapToTickEnabled="True" TickFrequency="0.01" ValueChanged="Slider_Compressing_ValueChanged" LargeChange="0.01" PreviewMouseLeftButtonDown="Slider_Compressing_PreviewMouseLeftButtonDown" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_Noise_PreviewMouseLeftButtonUp" />
<Slider x:Name="Slider_Compressing" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" IsSnapToTickEnabled="True" TickFrequency="0.01" ValueChanged="Slider_Compressing_ValueChanged" LargeChange="0.01" PreviewMouseLeftButtonDown="Slider_Compressing_PreviewMouseLeftButtonDown" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_MouseLeftButtonUp" KeyUp="Slider_KeyUp" />
<TextBlock TextWrapping="Wrap" Text="压缩" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="18" Margin="30,0,0,0"/>
<TextBlock x:Name="TextCompressingValue" TextWrapping="Wrap" Text="0%" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="18" Margin="0,0,30,0"/>
</Grid>
<Grid Grid.Row="3">
<Slider x:Name="Slider_Scaling" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" Value="1" TickFrequency="0.01" IsSnapToTickEnabled="True" LargeChange="0.01" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_Noise_PreviewMouseLeftButtonUp" Minimum="0.01" />
<Slider x:Name="Slider_Scaling" HorizontalAlignment="Stretch" Margin="100,0,100,0" VerticalAlignment="Center" Maximum="1" Value="1" TickFrequency="0.01" IsSnapToTickEnabled="True" LargeChange="0.01" SmallChange="0.01" PreviewMouseLeftButtonUp="Slider_MouseLeftButtonUp" Minimum="0.01" KeyUp="Slider_KeyUp" />
<TextBlock TextWrapping="Wrap" Text="缩放" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="18" Margin="30,0,0,0"/>
<TextBlock x:Name="TextScalingValue" TextWrapping="Wrap" Text="100%" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="18" Margin="0,0,30,0"/>
</Grid>
</Grid>
</Grid>
<Grid Grid.Row="2">
<TextBlock TextWrapping="Wrap" Text="预设档" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="24" Margin="30,30,0,0"/>
<Grid Grid.Row="3">

<Grid VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30,80,0,0" Height="120" Width="120">
<Grid VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30,30,0,0" Height="120" Width="120">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<RadioButton x:Name="RB_Low" Content="元青花(低)" GroupName="WeatheringDefault" FontSize="18" Click="RB_Low_Click"/>
<RadioButton x:Name="RB_Low" Content="元青花(低)" GroupName="WeatheringDefault" FontSize="18" Click="RB_Low_Click" VerticalContentAlignment="Center" HorizontalContentAlignment="Left"/>

</Grid>
<Grid Grid.Row="1">
<RadioButton x:Name="RB_Medium" Content="唐三彩(中)" GroupName="WeatheringDefault" FontSize="18" Click="RB_Medium_Click"/>
<RadioButton x:Name="RB_Medium" Content="唐三彩(中)" GroupName="WeatheringDefault" FontSize="18" Click="RB_Medium_Click" VerticalContentAlignment="Center" HorizontalContentAlignment="Left"/>

</Grid>
<Grid Grid.Row="2">
<RadioButton x:Name="RB_High" Content="兵马俑(高)" GroupName="WeatheringDefault" FontSize="18" Click="RB_High_Click"/>
<RadioButton x:Name="RB_High" Content="兵马俑(高)" GroupName="WeatheringDefault" FontSize="18" Click="RB_High_Click" VerticalContentAlignment="Center" HorizontalContentAlignment="Left"/>

</Grid>
<Grid Grid.Row="3">
<RadioButton x:Name="RB_Custom" Content="自定义" GroupName="WeatheringDefault" FontSize="18"/>
<RadioButton x:Name="RB_Custom" Content="自定义" GroupName="WeatheringDefault" FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left"/>

</Grid>

</Grid>
<Button x:Name="Btn_Revert" Content="重置" Margin="0,0,180,50" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="18" Width="120" Background="#FFCCCCCC" Foreground="Black" Height="30" Click="Btn_Revert_Click" />
<Button x:Name="Btn_Revert" Content="重置" Margin="0,0,180,60" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="18" Width="120" Background="#FFCCCCCC" Foreground="Black" Height="30" Click="Btn_Revert_Click" />

<Button x:Name="Btn_Save" Content="保存" Margin="0,30,30,50" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="18" Width="120" Background="#FF005FB8" Foreground="White" Height="30" Click="Btn_Save_Click" />
<Button x:Name="Btn_Save" Content="保存" Margin="0,0,30,60" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="18" Width="120" Background="#FF005FB8" Foreground="White" Height="30" Click="Btn_Save_Click" />
<TextBlock HorizontalAlignment="Right" Margin="0,0,30,10" TextWrapping="Wrap" VerticalAlignment="Bottom" Foreground="Gray" >
Copyright © 2021
<Hyperlink
Expand All @@ -121,6 +124,7 @@
</Hyperlink>

</TextBlock>
<CheckBox x:Name="Check_Watermark" Content="添加水印" HorizontalAlignment="Left" Margin="30,0,0,64" VerticalAlignment="Bottom" FontSize="18" VerticalContentAlignment="Center" Click="Check_Watermark_Click"/>
</Grid>
</Grid>
</Grid>
Expand Down
Loading

0 comments on commit 1a206db

Please sign in to comment.