diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/.vs/HaoYue.Image2Thumbnail/DesignTimeBuild/.dtbcache b/.vs/HaoYue.Image2Thumbnail/DesignTimeBuild/.dtbcache
new file mode 100644
index 0000000..ff7128e
Binary files /dev/null and b/.vs/HaoYue.Image2Thumbnail/DesignTimeBuild/.dtbcache differ
diff --git a/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/db.lock b/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/db.lock
new file mode 100644
index 0000000..e69de29
diff --git a/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide b/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide
new file mode 100644
index 0000000..4e7b1b7
Binary files /dev/null and b/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide differ
diff --git a/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide-shm b/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide-shm
new file mode 100644
index 0000000..3126d4c
Binary files /dev/null and b/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide-shm differ
diff --git a/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide-wal b/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide-wal
new file mode 100644
index 0000000..d50ae89
Binary files /dev/null and b/.vs/HaoYue.Image2Thumbnail/v15/Server/sqlite3/storage.ide-wal differ
diff --git a/HaoYue.Image2Thumbnail.sln b/HaoYue.Image2Thumbnail.sln
new file mode 100644
index 0000000..c2b483a
--- /dev/null
+++ b/HaoYue.Image2Thumbnail.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27703.2026
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HaoYue.Image2Thumbnail", "HaoYue.Image2Thumbnail\HaoYue.Image2Thumbnail.csproj", "{2E03FC1D-AF90-4124-BFA0-29065513169B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2E03FC1D-AF90-4124-BFA0-29065513169B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2E03FC1D-AF90-4124-BFA0-29065513169B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2E03FC1D-AF90-4124-BFA0-29065513169B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2E03FC1D-AF90-4124-BFA0-29065513169B}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {B70DB4FC-AC1A-4966-B361-5332ACF56311}
+ EndGlobalSection
+EndGlobal
diff --git a/HaoYue.Image2Thumbnail/App.xaml b/HaoYue.Image2Thumbnail/App.xaml
new file mode 100644
index 0000000..57ba96c
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/App.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HaoYue.Image2Thumbnail/App.xaml.cs b/HaoYue.Image2Thumbnail/App.xaml.cs
new file mode 100644
index 0000000..005c672
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/App.xaml.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Windows;
+
+namespace HaoYue.Image2Thumbnail
+{
+ ///
+ /// App.xaml 的交互逻辑
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/HaoYue.Image2Thumbnail/HaoYue.Image2Thumbnail.csproj b/HaoYue.Image2Thumbnail/HaoYue.Image2Thumbnail.csproj
new file mode 100644
index 0000000..55e704a
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/HaoYue.Image2Thumbnail.csproj
@@ -0,0 +1,107 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {2E03FC1D-AF90-4124-BFA0-29065513169B}
+ WinExe
+ HaoYue.Image2Thumbnail
+ HaoYue.Image2Thumbnail
+ v4.0
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+ ..\packages\ControlzEx.3.0.2.4\lib\net40\ControlzEx.dll
+
+
+ ..\packages\MahApps.Metro.1.6.5\lib\net40\MahApps.Metro.dll
+
+
+
+
+
+ ..\packages\ControlzEx.3.0.2.4\lib\net40\System.Windows.Interactivity.dll
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
\ No newline at end of file
diff --git a/HaoYue.Image2Thumbnail/MainWindow.xaml b/HaoYue.Image2Thumbnail/MainWindow.xaml
new file mode 100644
index 0000000..3cf7561
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/MainWindow.xaml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 默认质量
+ 高质量,低速度
+ 低质量,高速度
+ 假定线性值
+ 灰度修正
+
+
+
+
diff --git a/HaoYue.Image2Thumbnail/MainWindow.xaml.cs b/HaoYue.Image2Thumbnail/MainWindow.xaml.cs
new file mode 100644
index 0000000..5554493
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/MainWindow.xaml.cs
@@ -0,0 +1,534 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+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 MahApps.Metro.Controls;
+using MahApps.Metro.Controls.Dialogs;
+using System.IO;
+using System.Security.Cryptography;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace HaoYue.Image2Thumbnail
+{
+ ///
+ /// MainWindow.xaml 的交互逻辑
+ ///
+ public partial class MainWindow : MetroWindow
+ {
+ public int FileALLCount = 0;
+ public int FinishedFileCount = 0;
+
+ //图片压缩比率
+ public double ReductionRatio = 0;
+ //图片压缩质量
+ public int OutImagequality = 0;
+
+ public int ThreadCount = 0;
+
+ public bool IsSetMaxWH = false;
+
+ public int MaxW = 0;
+
+ public int MaxH = 0;
+
+ public bool IsDeleteSrcFile = false;
+
+ public DateTime StartDT;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void MaxMinWH_Checked(object sender, RoutedEventArgs e)
+ {
+ Text_MaxW.IsEnabled = true;
+ Text_MaxH.IsEnabled = true;
+ Text_MaxH.Text = "480";
+ Text_MaxW.Text = "640";
+ }
+
+ private void MaxMinWH_unChecked(object sender, RoutedEventArgs e)
+ {
+ Text_MaxW.IsEnabled = false;
+ Text_MaxH.IsEnabled = false;
+ }
+
+ private void adout(object sender, RoutedEventArgs e)
+ {
+ this.ShowMessageAsync("批量缩略图(压缩)处理工具 XueyiImageTools Ver 1.0.0", "设置好您需要的设置(不设置默认也行)之后、\n拖入您需要处理的图片或者包含图片的文件夹即可", MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = "确定" });
+ }
+
+ //文件拖拽
+ private void FileDrop(object sender, DragEventArgs e)
+ {
+
+ ReductionRatio = this.Slider_ReductionRatio.Value;
+ switch (ComboBox_OutImagequality.Text)
+ {
+ case "默认质量":
+ OutImagequality = 0;
+ break;
+ case "低质量,高速度":
+ OutImagequality = 1;
+ break;
+ case "高质量,低速度":
+ OutImagequality = 2;
+ break;
+ case "灰度修正":
+ OutImagequality = 3;
+ break;
+ case "假定线性值":
+ OutImagequality = 4;
+ break;
+ }
+ ThreadCount = (int)this.Slider_ThreadCount.Value;
+ IsSetMaxWH = (bool)this.CheckBox_MaxMinWH.IsChecked;
+ if (IsSetMaxWH)
+ {
+ try
+ {
+ MaxH = Convert.ToInt32(this.Text_MaxH.Text);
+ MaxW = Convert.ToInt32(this.Text_MaxW.Text);
+ }
+ catch
+ {
+ new Thread(() =>
+ {
+ this.Dispatcher.Invoke(new Action(() =>
+ {
+ this.ShowMessageAsync("错误!", "使用尺寸限制、请正确填写尺寸大小限制".ToString(), MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = "确定" });
+ }));
+ }).Start();
+ return;
+ }
+ }
+ IsDeleteSrcFile = (bool)this.CheckBox_IsDeleteSrcFile.IsChecked;
+ Thread t = new Thread(delegate ()
+ {
+ SetAsyncFile(e);
+ });
+ t.Start();
+ }
+
+
+
+ private void SetAsyncFile(DragEventArgs e)
+ {
+
+ StartDT = DateTime.Now;
+
+ //统计文件数量先
+ FileALLCount = 0;
+ FinishedFileCount = 0;
+
+
+ for (int i = 0; i < ((System.Array)e.Data.GetData(DataFormats.FileDrop)).Length; i++)
+ {
+ string fileName = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(i).ToString();
+ //然后你要做的事情
+ if (Directory.Exists(fileName))//是文件夹的情况
+ {
+ FileALLCount += GetDirWithDirGetNumber(fileName);
+ }
+ else if (File.Exists(fileName))//是文件的情况
+ {
+ switch (fileName.Substring(fileName.LastIndexOf(".") + 1).ToLower())
+ {
+ case "jpeg":
+ case "jpg":
+ case "png":
+ case "bmp":
+ case "gif":
+ case "wmf":
+ FileALLCount++;
+ break;
+ default:
+ continue;
+ break;
+ }
+ }
+ }
+
+ SetmyFilePercentage();
+
+ //处理
+ int index = 0;
+ for (int i = 0; i < ((System.Array)e.Data.GetData(DataFormats.FileDrop)).Length; i++)
+ {
+ string fileName = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(i).ToString();
+ //然后你要做的事情
+ if (Directory.Exists(fileName))//是文件夹的情况
+ {
+ GetDirWithDir(fileName);
+ }
+ else if (File.Exists(fileName))//是文件的情况
+ {
+
+ //单个文件处理
+ OneImageSet(fileName);
+ }
+ index++;
+ if (index % 20 == 0)
+ {
+ GC.Collect();
+ }
+ }
+
+
+ new Thread(() =>
+ {
+ this.Dispatcher.Invoke(new Action(() =>
+ {
+ this.ShowMessageAsync("处理完毕!", "共处理" + FinishedFileCount + "个文件 耗时:" + (DateTime.Now - StartDT).ToString(), MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = "确定" });
+ }));
+ }).Start();
+ }
+
+ ///
+ /// 遍历文件夹下的文件总数
+ ///
+ ///
+ ///
+ public int GetDirWithDirGetNumber(string diruriFullName)
+ {
+ int filecount = 0;
+ DirectoryInfo dir = new DirectoryInfo(diruriFullName);
+ var Directories = dir.GetDirectories();
+ //当前目录下的目录
+ foreach (var d in Directories)
+ {
+ filecount += GetDirWithDirGetNumber(d.FullName);
+ }
+ Directories = null;
+
+ //当前目录下的文件
+ DirectoryInfo dirinfo = new DirectoryInfo(diruriFullName);
+
+ int count = 0;
+ foreach (var f in dir.GetFiles())
+ {
+ switch (f.FullName.Substring(f.FullName.LastIndexOf(".") + 1).ToLower())
+ {
+ case "jpeg":
+ case "jpg":
+ case "png":
+ case "bmp":
+ case "gif":
+ case "wmf":
+ count++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ filecount += count;
+ return filecount;
+ }
+
+
+ public void SetFileInfo(string FileInfo)
+ {
+ new Thread(
+ delegate ()
+ {
+ this.Dispatcher.Invoke(new Action(() =>
+ Lable_SetFileInfo.Content = FileInfo
+ ));
+ }
+ ).Start();
+ }
+
+
+ ///
+ /// 更新文件处理数量和总数量
+ ///
+ ///
+ public void SetmyFilePercentage()
+ {
+ new Thread(
+ delegate ()
+ {
+ this.Dispatcher.Invoke(new Action(() =>
+ myFilePercentage.Content = FinishedFileCount + " / " + FileALLCount
+
+ ));
+
+ this.Dispatcher.Invoke(new Action(() =>
+ myp.Value = ((double)FinishedFileCount / (double)FileALLCount * 100)
+ ));
+
+ this.Dispatcher.Invoke(new Action(() =>
+ myPercentage.Content = (int)myp.Value + "%"
+ ));
+ }
+ ).Start();
+ }
+
+
+
+
+
+ public class tImageReturn
+ {
+ public int smallWidth { get; set; }
+ public int smallHeight { get; set; }
+ public string smallImagePath { get; set; }
+ }
+
+
+ public void GetDirWithDir(string diruriFullName)
+ {
+ DirectoryInfo dir = new DirectoryInfo(diruriFullName);
+ var Directories = dir.GetDirectories();
+ //当前目录下的目录
+ foreach (var d in Directories)
+ {
+ GetDirWithDir(d.FullName);
+ GC.Collect();
+ }
+ Directories = null;
+ //当前目录下的文件
+ SetDirALLSmallImageToFile(diruriFullName);
+ }
+
+
+
+ public void SetDirALLSmallImageToFile(string diruriFullName)
+ {
+ DirectoryInfo dir = new DirectoryInfo(diruriFullName);
+ var files = dir.GetFiles();
+ int index = 0;
+ foreach (var f in files)
+ {
+ if(OneImageSet(f.FullName))
+ index++;
+ if (index % 20 == 0)
+ {
+ GC.Collect();
+ }
+ }
+
+ files = null;
+ }
+
+ public bool OneImageSet(string FileFullName)
+ {
+
+ SetFileInfo(FileFullName);
+ //if (File.Exists(
+ // f.FullName.Substring(0, f.FullName.LastIndexOf(".")) + "_s0" + f.FullName.Substring(f.FullName.LastIndexOf("."))
+ // ))
+ //{
+ // //continue;
+ // return false;
+ //}
+
+ //if (f.Name.Contains("_s0" + f.Name.Substring(f.Name.LastIndexOf("."))))
+ //{
+ // //continue;
+
+ // return false;
+ //}
+
+ switch (FileFullName.Substring(FileFullName.LastIndexOf(".") + 1).ToLower())
+ {
+ case "jpeg":
+ case "jpg":
+ case "png":
+ case "bmp":
+ case "gif":
+ case "wmf":
+ break;
+ default:
+ //continue;
+ return false;
+ break;
+ }
+
+
+ System.Drawing.Image img = System.Drawing.Image.FromFile(FileFullName);
+ var height = img.Height;
+ var Width = img.Width;
+
+ tImageReturn tp;
+ //if (height < 600 || Width < 600)
+ // tp = tImage(FileFullName, Width / 2, height / 2);//制作缩略图
+ //else
+ // tp = tImage(FileFullName, Width / 6, height / 6);//制作缩略图
+
+
+ int smallW = Width / (int)ReductionRatio;
+ int smallH = height / (int)ReductionRatio;
+
+ if (IsSetMaxWH)
+ {
+ if (smallW > MaxW || smallH > MaxH)
+ {
+ //获取第一张绘制图的大小,(比较 原图的宽/缩略图的宽 和 原图的高/缩略图的高)
+ if (((decimal)MaxW) / smallW >= ((decimal)MaxH) / smallH)
+ {
+ smallH = MaxH;
+ smallW = (int)((Width * MaxH) / height);
+ }
+ else
+ {
+ smallW = MaxW;
+ smallH = (int)((MaxW * height) / Width);
+ }
+ }
+ }
+
+ tp = tImage(FileFullName,smallW,smallH);//制作缩略图
+
+
+
+ FinishedFileCount++;
+ SetmyFilePercentage();
+ return true;
+
+ }
+
+
+ ///
+ /// 根据路径生成缩略图片
+ ///
+ /// 源图片的完整路径
+ /// 缩略图的宽
+ /// 高
+ ///
+ public tImageReturn tImage(string filePath, int _width, int _height)
+ {
+
+ try
+ {
+ using (System.Drawing.Image sourceImage = System.Drawing.Image.FromFile(filePath))
+ {
+ //原图宽度和高度
+ int width = sourceImage.Width;
+ int height = sourceImage.Height;
+ int smallWidth = _width;
+ int smallHeight = _height;
+
+ ////获取第一张绘制图的大小,(比较 原图的宽/缩略图的宽 和 原图的高/缩略图的高)
+ //if (((decimal)width) / _width >= ((decimal)height) / _height)
+ //{
+ // smallWidth = _width;
+ // smallHeight = (int)((double)height / ((double)width / (double)_width));
+ //}
+ //else
+ //{
+ // smallWidth = (int)((double)width / ((double)height / (double)_height));
+ // smallHeight = _height;
+ //}
+
+ //判断缩略图在当前文件夹下是否同名称文件存在
+ //缩略图保存的绝对路径
+ string smallImagePath = ExistsOrCreateFile(filePath);
+ // string smallImagePath = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["PhotoPath"]);
+ //新建一个图板,以最小等比例压缩大小绘制原图
+ using (System.Drawing.Image bitmap = new System.Drawing.Bitmap(smallWidth, smallHeight))
+ {
+ using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap))
+ {
+ g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+ g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+ g.CompositingQuality = (System.Drawing.Drawing2D.CompositingQuality)OutImagequality;
+ g.Clear(System.Drawing.Color.Black);
+ g.DrawImage(
+ sourceImage,
+ new System.Drawing.Rectangle(-2, -2, smallWidth + 2, smallHeight + 2),
+ new System.Drawing.Rectangle(0, 0, width, height),
+ System.Drawing.GraphicsUnit.Pixel
+ );
+ g.Dispose();
+ bitmap.Save(smallImagePath, System.Drawing.Imaging.ImageFormat.Jpeg);
+ }
+ }
+ tImageReturn tir = new tImageReturn();
+ tir.smallHeight = smallHeight;
+ tir.smallWidth = smallWidth;
+ tir.smallImagePath = System.IO.Path.GetFileName(smallImagePath);
+ return tir;
+ }
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+
+
+
+ ///
+ /// 判断制定路径下是否存在新文件
+ ///
+ /// 源文件的完整路径
+ /// 新文件的完整路径
+ private string ExistsOrCreateFile(string fullPath)
+ {
+ int num = 0;
+ string fileName = System.IO.Path.GetFileNameWithoutExtension(fullPath);
+ string extendName = System.IO.Path.GetExtension(fullPath);
+ string path = System.IO.Path.GetDirectoryName(fullPath);
+
+ StringBuilder newPath = new StringBuilder();
+
+ while (true)
+ {
+ newPath.Length = 0;
+
+ newPath.Append(path + "\\");
+
+ //string[] sArray = fileName.Split('.');
+ //newPath.Append(sArray[0]);
+
+
+ newPath.Append(fileName);
+ newPath.Append("_small" + num);
+
+ //newPath.Append(sArray[1]);
+
+ newPath.Append(extendName);
+
+ if (!System.IO.File.Exists(newPath.ToString()))
+ break;
+
+ num++;
+ }
+
+ return newPath.ToString();
+ }
+
+ private void tb_PreviewTextInput(object sender, TextCompositionEventArgs e)
+ {
+ System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex("[^0-9]");
+
+ e.Handled = re.IsMatch(e.Text);
+ }
+
+
+
+
+ //public void SetFileInfoLabel(string FileInfo)
+ //{
+ // new Thread()
+ // { }.Start();
+ //}
+
+
+ }
+}
diff --git a/HaoYue.Image2Thumbnail/Properties/AssemblyInfo.cs b/HaoYue.Image2Thumbnail/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..4f7a644
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HaoYue.Image2Thumbnail")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HaoYue.Image2Thumbnail")]
+[assembly: AssemblyCopyright("Copyright © 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+//若要开始生成可本地化的应用程序,请设置
+//.csproj 文件中的 CultureYouAreCodingWith
+//例如,如果您在源文件中使用的是美国英语,
+//使用的是美国英语,请将 设置为 en-US。 然后取消
+//对以下 NeutralResourceLanguage 特性的注释。 更新
+//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //主题特定资源词典所处位置
+ //(未在页面中找到资源时使用,
+ //或应用程序资源字典中找到时使用)
+ ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
+ //(未在页面中找到资源时使用,
+ //、应用程序或任何主题专用资源字典中找到时使用)
+)]
+
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/HaoYue.Image2Thumbnail/Properties/Resources.Designer.cs b/HaoYue.Image2Thumbnail/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..4cd694d
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: 4.0.30319.42000
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace HaoYue.Image2Thumbnail.Properties
+{
+
+
+ ///
+ /// 强类型资源类,用于查找本地化字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// 返回此类使用的缓存 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HaoYue.Image2Thumbnail.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 覆盖当前线程的 CurrentUICulture 属性
+ /// 使用此强类型的资源类的资源查找。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/HaoYue.Image2Thumbnail/Properties/Resources.resx b/HaoYue.Image2Thumbnail/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/HaoYue.Image2Thumbnail/Properties/Settings.Designer.cs b/HaoYue.Image2Thumbnail/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..b7a5442
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace HaoYue.Image2Thumbnail.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/HaoYue.Image2Thumbnail/Properties/Settings.settings b/HaoYue.Image2Thumbnail/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HaoYue.Image2Thumbnail/packages.config b/HaoYue.Image2Thumbnail/packages.config
new file mode 100644
index 0000000..ce0c27c
--- /dev/null
+++ b/HaoYue.Image2Thumbnail/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file