Skip to content

Commit

Permalink
取消1024大小限制,增加200*200的输出大小
Browse files Browse the repository at this point in the history
Fix #5
  • Loading branch information
liesauer committed May 3, 2023
1 parent fe390b9 commit 97d5a31
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
`png` `jpg` `bmp` `gif`

## 图片大小限制
`1024` x `1024`
无(不建议超过`1024` x `1024`

## 特别注意说明
受表情包格式的限制,原图片色彩越多越丰富,转换出来的表情包失真则会越严重(半透明图片也一样),可以尝试切换不同转换模式得到效果最佳的一个表情包使用。
受表情包格式的限制,原图片色彩越多越丰富,转换出来的表情包失真则会越严重(半透明图片也一样),可以尝试切换不同转换模式得到效果最佳的一个表情包使用。如果图片过大,内容可能会看不清,微信上表情包最大显示大小为`200` x `200`(强制性)。
5 changes: 4 additions & 1 deletion pic2meme/ChangeLogWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public ChangeLogWindow()
this.MinWidth = this.MaxWidth = this.Width;
this.MinHeight = this.MaxHeight = this.Height;
ChangeLog.Text = @"
v1.3.2 - 2023/05/03
1. 取消1024大小限制,增加200*200的输出大小
v1.3 - 2022/04/08
1. 支持多种输出大小
Expand All @@ -45,7 +48,7 @@ 2. GIF动图预览显示
v1.0.0 - 2020/12/02
1. 微信表情包转换
© 2020-2022 LiesAuer
© 2020-2023 LiesAuer
https://www.liesauer.net/
".Trim();
}
Expand Down
6 changes: 3 additions & 3 deletions pic2meme/InfoWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public InfoWindow()
Usage.Text = @"
支持图片格式:JPG、PNG、BMP、GIF
表情包透明度:支持(但不支持半透明)
图片大小限制:1024x1024
图片大小限制:无(不建议超过1024x1024)
特别注意说明:受表情包格式的限制,原图片色彩越多越丰富,转换出来的表情包失真则会越严重(半透明图片也一样),可以尝试切换不同转换模式得到效果最佳的一个表情包使用。
特别注意说明:受表情包格式的限制,原图片色彩越多越丰富,转换出来的表情包失真则会越严重(半透明图片也一样),可以尝试切换不同转换模式得到效果最佳的一个表情包使用。如果图片过大,内容可能会看不清,微信上表情包最大显示大小为200*200(强制性)。
© 2020-2022 LiesAuer
© 2020-2023 LiesAuer
https://www.liesauer.net/
".Trim();
}
Expand Down
11 changes: 6 additions & 5 deletions pic2meme/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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.3" Height="562.632" Width="538.297" AllowDrop="True" Drop="Window_Drop" KeyDown="Window_KeyDown" ResizeMode="CanMinimize">
Title="微信表情包工具 v1.3.2" Height="562.632" Width="538.297" AllowDrop="True" Drop="Window_Drop" KeyDown="Window_KeyDown" ResizeMode="CanMinimize">
<Grid>
<Label x:Name="Notice" Content="拖动或粘贴图片到此处进行表情包转换" FontSize="22" Margin="30,20,30,0" VerticalAlignment="Top" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Stretch" />
<hc:GifImage x:Name="Preview" Stretch="Uniform" Height="200" Width="200" Margin="166,191,166.5,116" />
Expand All @@ -17,10 +17,11 @@
<RadioButton x:Name="CovertMode1" Content="模式1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="135,86,0,0" Height="38" Width="85" FontSize="20" GroupName="CovertMode" IsChecked="True" Checked="ReCovert" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="CovertMode2" Content="模式2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,86,19.5,0" Height="38" FontSize="20" GroupName="CovertMode" Checked="ReCovert" FocusVisualStyle="{x:Null}" Width="85" />
<Label x:Name="PreviewLabel" Content="" Margin="166,266,166.5,191" BorderThickness="0" FontSize="18" Width="200" Height="50" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
<RadioButton x:Name="SizeMode_Raw" Content="原始" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="135,132,0,0" Height="38" Width="70" FontSize="20" GroupName="SizeMode" IsChecked="True" Checked="ReCovert" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="SizeMode_40" Content="40" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="243,132,0,0" Height="38" Width="70" FontSize="20" GroupName="SizeMode" IsChecked="False" Checked="ReCovert" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="SizeMode_80" Content="80" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="334,132,0,0" Height="38" Width="70" FontSize="20" GroupName="SizeMode" IsChecked="False" Checked="ReCovert" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="SizeMode_120" Content="120" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,132,34.5,0" Height="38" FontSize="20" GroupName="SizeMode" IsChecked="False" Checked="ReCovert" FocusVisualStyle="{x:Null}" Width="70" />
<RadioButton x:Name="SizeMode_Raw" Content="原始" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="135,132,0,0" Height="38" Width="65" FontSize="20" GroupName="SizeMode" IsChecked="True" Checked="ReCovert" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="SizeMode_40" Content="40" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="216,132,0,0" Height="38" Width="50" FontSize="20" GroupName="SizeMode" IsChecked="False" Checked="ReCovert" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="SizeMode_80" Content="80" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="283,132,0,0" Height="38" Width="50" FontSize="20" GroupName="SizeMode" IsChecked="False" Checked="ReCovert" FocusVisualStyle="{x:Null}" />
<RadioButton x:Name="SizeMode_120" Content="120" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,132,118.5,0" Height="38" FontSize="20" GroupName="SizeMode" IsChecked="False" Checked="ReCovert" FocusVisualStyle="{x:Null}" Width="65" />
<RadioButton x:Name="SizeMode_200" Content="200" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,132,39.5,0" Height="38" FontSize="20" GroupName="SizeMode" IsChecked="False" Checked="ReCovert" FocusVisualStyle="{x:Null}" Width="65" />
<Label Content="转换模式:" HorizontalAlignment="Left" Margin="20,87,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left" BorderThickness="0" Width="108" FontSize="20" Height="36"/>
<Label Content="输出大小:" HorizontalAlignment="Left" Margin="20,133,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left" BorderThickness="0" Width="108" FontSize="20" Height="36"/>
</Grid>
Expand Down
6 changes: 4 additions & 2 deletions pic2meme/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private int GetSizeMode()
if (SizeMode_40.IsChecked.GetValueOrDefault(false)) return 2;
if (SizeMode_80.IsChecked.GetValueOrDefault(false)) return 3;
if (SizeMode_120.IsChecked.GetValueOrDefault(false)) return 4;
if (SizeMode_200.IsChecked.GetValueOrDefault(false)) return 5;

return 0;
}
Expand Down Expand Up @@ -97,6 +98,7 @@ private async void pic2meme(bool keepOriginal = false)
if (sizeMode == 2) forceSize = 40;
if (sizeMode == 3) forceSize = 80;
if (sizeMode == 4) forceSize = 120;
if (sizeMode == 5) forceSize = 200;

var sourceImage = "";

Expand Down Expand Up @@ -217,13 +219,13 @@ private async void pic2meme(bool keepOriginal = false)
return;
}

var (width, height) = Utils.GetImageSize(sourceImage);
/*var (width, height) = Utils.GetImageSize(sourceImage);
if (width > 1024 || height > 1024)
{
Notice.Content = "转换失败:图片大小不得超过1024 x 1024";
return;
}
}*/

if (format == ImageFormat.Gif)
{
Expand Down
Binary file modified screenshot_00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 97d5a31

Please sign in to comment.