Skip to content

Commit

Permalink
支持转换网页图片
Browse files Browse the repository at this point in the history
  • Loading branch information
liesauer committed Mar 21, 2022
1 parent 7f7221e commit c4ef452
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 49 deletions.
2 changes: 1 addition & 1 deletion pic2meme_NG.sln → pic2meme.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31019.35
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pic2meme_NG", "pic2meme_NG\pic2meme_NG.csproj", "{B5E4F054-95C5-41B1-A983-630F2096737A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pic2meme", "pic2meme\pic2meme.csproj", "{B5E4F054-95C5-41B1-A983-630F2096737A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ public ChangeLogWindow()
this.MinWidth = this.MaxWidth = this.Width;
this.MinHeight = this.MaxHeight = this.Height;
ChangeLog.Text = @"
v1.2.0 - 2022/03/21
1. 支持转换网页图片
v1.1.0 - 2021/10/28
1. UI优化、性能优化
2. GIF动图预览显示
v1.0.0 - 2020/12/02
1. 微信表情包转换
© 2020-2021 LiesAuer
© 2020-2022 LiesAuer
https://www.liesauer.net/
".Trim();
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public InfoWindow()
特别注意说明:受表情包格式的限制,原图片色彩越多越丰富,转换出来的表情包失真则会越严重(半透明图片也一样),可以尝试切换不同转换模式得到效果最佳的一个表情包使用。
© 2020-2021 LiesAuer
© 2020-2022 LiesAuer
https://www.liesauer.net/
".Trim();
}
Expand Down
18 changes: 9 additions & 9 deletions pic2meme_NG/MainWindow.xaml → pic2meme/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:pic2meme" xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Title="微信表情包工具 v1.1.0" Height="499.632" Width="561.797" AllowDrop="True" Drop="Window_Drop" KeyDown="Window_KeyDown" ResizeMode="CanMinimize">
Title="微信表情包工具 v1.2" Height="499.632" Width="463.297" AllowDrop="True" Drop="Window_Drop" KeyDown="Window_KeyDown" ResizeMode="CanMinimize">
<Grid>
<Label x:Name="Notice" Content="拖动或粘贴图片到此处进行表情包转换" FontSize="22" Margin="20,20,20,0" VerticalAlignment="Top" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
<hc:GifImage x:Name="Preview" Stretch="Uniform" Width="201" Height="201" />
<Button x:Name="Usage" Content="使用说明" HorizontalAlignment="Left" Margin="49,0,0,27" VerticalAlignment="Bottom" Width="116" Height="52" FontSize="20" Click="Usage_Click" FocusVisualStyle="{x:Null}" />
<Button x:Name="ChangeLog" Content="更新历史" HorizontalAlignment="Left" Margin="219,0,0,27" VerticalAlignment="Bottom" Width="116" Height="52" FontSize="20" Click="ChangeLog_Click" FocusVisualStyle="{x:Null}" />
<Button x:Name="BuyMyACoffee" Content="支持一下" HorizontalAlignment="Right" Margin="0,0,49,27" VerticalAlignment="Bottom" Height="52" FontSize="20" Width="116" Click="BuyMyACoffee_Click" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="CovertMode1" Content="模式1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="80,94,0,0" Height="38" Width="85" FontSize="20" GroupName="CovertMode" IsChecked="True" Checked="CovertMode1_Checked" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="CovertMode2" Content="模式2" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="390,94,0,0" Height="38" Width="85" FontSize="20" GroupName="CovertMode" Checked="CovertMode2_Checked" FocusVisualStyle="{x:Null}" />
<Label x:Name="PreviewLabel" Content="" HorizontalAlignment="Left" Margin="178,216,0,0" VerticalAlignment="Top" BorderThickness="0" FontSize="22" Width="200" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
<Label x:Name="Notice" Content="拖动或粘贴图片到此处进行表情包转换" FontSize="22" Margin="30,20,0,0" VerticalAlignment="Top" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left" Width="395" />
<hc:GifImage x:Name="Preview" Stretch="Uniform" Height="201" Margin="127,144,0,126" HorizontalAlignment="Left" Width="201" />
<Button x:Name="Usage" Content="使用说明" HorizontalAlignment="Left" Margin="30,0,0,27" VerticalAlignment="Bottom" Width="116" Height="52" FontSize="20" Click="Usage_Click" FocusVisualStyle="{x:Null}" />
<Button x:Name="ChangeLog" Content="更新历史" HorizontalAlignment="Left" Margin="170,0,0,27" VerticalAlignment="Bottom" Width="116" Height="52" FontSize="20" Click="ChangeLog_Click" FocusVisualStyle="{x:Null}" />
<Button x:Name="BuyMyACoffee" Content="支持一下" HorizontalAlignment="Left" Margin="310,0,0,27" VerticalAlignment="Bottom" Height="52" FontSize="20" Click="BuyMyACoffee_Click" FocusVisualStyle="{x:Null}" Width="116" />
<RadioButton x:Name="CovertMode1" Content="模式1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,94,0,0" Height="38" Width="85" FontSize="20" GroupName="CovertMode" IsChecked="True" Checked="CovertMode1_Checked" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="CovertMode2" Content="模式2" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="340,94,0,0" Height="38" Width="85" FontSize="20" GroupName="CovertMode" Checked="CovertMode2_Checked" FocusVisualStyle="{x:Null}" />
<Label x:Name="PreviewLabel" Content="" HorizontalAlignment="Left" Margin="128,225,0,0" VerticalAlignment="Top" BorderThickness="0" FontSize="22" Width="200" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
</Grid>
</Window>
41 changes: 7 additions & 34 deletions pic2meme_NG/MainWindow.xaml.cs → pic2meme/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.IO;
using System.Net;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Drawing;
using System.Drawing.Imaging;
using Image = System.Drawing.Image;
using System.IO;
using System.Collections.Specialized;
using System.Threading.Tasks;
using Path = System.IO.Path;
using System.Xml;
using System.Net;

using Path = System.IO.Path;

namespace pic2meme
{
Expand All @@ -37,22 +26,6 @@ public MainWindow()
_init = true;
this.MinWidth = this.MaxWidth = this.Width;
this.MinHeight = this.MaxHeight = this.Height;

////SetPreview(@"C:\Users\LiesAuer\Desktop\3.gif");
////var format1 = Utils.DetectFormat(@"C:\Users\LiesAuer\Desktop\1.jpg");
////var format2 = Utils.DetectFormat(@"C:\Users\LiesAuer\Desktop\2.gif");
////var format3 = Utils.DetectFormat(@"C:\Users\LiesAuer\Desktop\3.gif");
////Utils.Any2GIF2(@"C:\Users\LiesAuer\Desktop\1.jpg", @"C:\Users\LiesAuer\Desktop\11.gif");
//Utils.Any2GIF(@"F:\Projects\pic2meme_NG\memes\test1.png", @"F:\Projects\pic2meme_NG\memes\test1_1.gif");
//Utils.Any2GIF2(@"F:\Projects\pic2meme_NG\memes\test1.png", @"F:\Projects\pic2meme_NG\memes\test1_2.gif");
//Utils.Any2GIF(@"F:\Projects\pic2meme_NG\memes\22.png", @"F:\Projects\pic2meme_NG\memes\22_1.gif");
//Utils.Any2GIF2(@"F:\Projects\pic2meme_NG\memes\22.png", @"F:\Projects\pic2meme_NG\memes\22_2.gif");
////Preview.Uri = new Uri($"pack://siteoforigin:,,,/F:/Projects/pic2meme_NG/memes/50.png");
////Preview.Uri = new Uri($"pack://siteoforigin:,,,/F:/Projects/pic2meme_NG/memes/200.png");
////Preview.Uri = new Uri($"pack://siteoforigin:,,,/F:/Projects/pic2meme_NG/memes/400.png");
////Preview.Uri = new Uri($"pack://siteoforigin:,,,/F:/Projects/pic2meme_NG/memes/100x600.png");
//Preview.Uri = new Uri($"pack://siteoforigin:,,,/F:/Projects/pic2meme_NG/memes/600x100.png");
//Preview.Uri = new Uri($"pack://siteoforigin:,,,/F:/Projects/pic2meme_NG/memes/44.gif");
}

private void Window_KeyDown(object sender, KeyEventArgs e)
Expand Down Expand Up @@ -163,7 +136,7 @@ private async void pic2meme()
using (WebClient client = new WebClient())
{
var tmp = GenerateTempFile(".gif");
client.DownloadFile(imgUrl, tmp);
await client.DownloadFileTaskAsync(imgUrl, tmp);
sourceImage = tmp;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("nulastudio")]
[assembly: AssemblyProduct("pic2meme")]
[assembly: AssemblyCopyright("Copyright © 2020-2021 LiesAuer")]
[assembly: AssemblyCopyright("Copyright © 2020-2022 LiesAuer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +51,5 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit c4ef452

Please sign in to comment.