├── .gitattributes
├── .gitignore
├── CommonLibrary
├── CommonLibrary.csproj
├── Enums
│ └── DeviceCap.cs
├── LibHelper
│ ├── ForegroundWindow.cs
│ ├── GlobalHookDllHelper.cs
│ ├── HotKeyDllHelper.cs
│ ├── PrScrnDllHelper.cs
│ └── System32DllHelper.cs
├── PrScrn.dll
├── Properties
│ └── AssemblyInfo.cs
└── Utils
│ └── IniConfigUtils.cs
├── GIFSicleTool
├── Form_gif_sicle_tool.Designer.cs
├── Form_gif_sicle_tool.cs
├── Form_gif_sicle_tool.resx
├── GIFSicleTool.csproj
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── gif_compress.png
│ └── gifsicle.exe
├── app.config
└── gif_compress.ico
├── MyScreenTools.sln
├── MyScreenTools
├── App.config
├── App.ico
├── Bean
│ ├── DictionaryMeansBean.cs
│ ├── OcrBasicBean.cs
│ ├── OcrExcelBean.cs
│ ├── Result.cs
│ ├── Result2.cs
│ ├── SimpleMeans.cs
│ ├── TextTranslateBasicBean.cs
│ ├── TextTranslateDictionaryBean.cs
│ ├── TransResultItem.cs
│ ├── TransResultItem2.cs
│ ├── WordResult.cs
│ └── WordsResultItem.cs
├── Enums
│ ├── BaiduYunType.cs
│ └── CatchType.cs
├── Libs
│ ├── AipSdk.dll
│ ├── Newtonsoft.Json.dll
│ └── System.Net.Http.dll
├── MyScreenTools.csproj
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ ├── Settings.settings
│ └── app.manifest
├── Readme.txt
├── Resources
│ ├── bg.jpg
│ ├── ocr_128.png
│ ├── ocr_200.png
│ ├── ocr_48.png
│ ├── ocr_64.png
│ ├── 下载.png
│ ├── 关于软件.png
│ ├── 取消 .png
│ ├── 快捷键.png
│ ├── 打开.png
│ ├── 确认.png
│ ├── 网站账号.png
│ ├── 设置.png
│ ├── 选择框-未选.png
│ └── 选择框_选中.png
├── UI
│ ├── Form_about.Designer.cs
│ ├── Form_about.cs
│ ├── Form_about.resx
│ ├── Form_baiduyun.Designer.cs
│ ├── Form_baiduyun.cs
│ ├── Form_baiduyun.resx
│ ├── Form_catch.Designer.cs
│ ├── Form_catch.cs
│ ├── Form_catch.resx
│ ├── Form_main.Designer.cs
│ ├── Form_main.cs
│ ├── Form_main.resx
│ ├── Form_paste.Designer.cs
│ ├── Form_paste.cs
│ ├── Form_paste.resx
│ ├── Form_shortcut.Designer.cs
│ ├── Form_shortcut.cs
│ └── Form_shortcut.resx
├── Utils
│ └── BaiduTranslateUtils.cs
└── bin
│ └── Debug
│ ├── AipSdk.dll
│ ├── Newtonsoft.Json.dll
│ ├── PrScrn.dll
│ ├── Readme.txt
│ └── 屏幕工具.exe
├── MyScreenToolsSetup
└── MyScreenToolsSetup.vdproj
├── README.md
├── ScreenColorPicker
├── App.config
├── LibHelper
│ └── GlobalHookDllHelper.cs
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ └── color.png
├── ScreenColorPicker.csproj
├── UI
│ ├── Form_color.Designer.cs
│ ├── Form_color.cs
│ └── Form_color.resx
├── Utils
│ └── ColorConversionUtils.cs
└── color.ico
├── ScreenTextPaster
├── App.config
├── FormTextPaster.Designer.cs
├── FormTextPaster.cs
├── FormTextPaster.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── ScreenTextPaster.csproj
└── ScreenToGif
├── App.config
├── Encoding
├── AnimatedGifEncoder.cs
├── FrameInfo.cs
├── GifDecoder.cs
├── GifEncoder.cs
├── ImageUtil.cs
├── LzwEncoder.cs
├── NeuQuant.cs
└── PixelUtil.cs
├── LibHelper
├── HotKeyDllHelper.cs
└── System32DllHelper.cs
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── Resources
└── gif.png
├── ScreenToGif.csproj
├── UI
├── Form_gif_main.Designer.cs
├── Form_gif_main.cs
└── Form_gif_main.resx
└── gif.ico
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 |
11 | [Dd]ebug/
12 | [Rr]elease/
13 | x64/
14 | build/
15 | [Bb]in/
16 | [Oo]bj/
17 |
18 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
19 | !packages/*/build/
20 |
21 | # MSTest test Results
22 | [Tt]est[Rr]esult*/
23 | [Bb]uild[Ll]og.*
24 |
25 | *_i.c
26 | *_p.c
27 | *.ilk
28 | *.meta
29 | *.obj
30 | *.pch
31 | *.pdb
32 | *.pgc
33 | *.pgd
34 | *.rsp
35 | *.sbr
36 | *.tlb
37 | *.tli
38 | *.tlh
39 | *.tmp
40 | *.tmp_proj
41 | *.log
42 | *.vspscc
43 | *.vssscc
44 | .builds
45 | *.pidb
46 | *.log
47 | *.scc
48 |
49 | # Visual C++ cache files
50 | ipch/
51 | *.aps
52 | *.ncb
53 | *.opensdf
54 | *.sdf
55 | *.cachefile
56 |
57 | # Visual Studio profiler
58 | *.psess
59 | *.vsp
60 | *.vspx
61 |
62 | # Guidance Automation Toolkit
63 | *.gpState
64 |
65 | # ReSharper is a .NET coding add-in
66 | _ReSharper*/
67 | *.[Rr]e[Ss]harper
68 |
69 | # TeamCity is a build add-in
70 | _TeamCity*
71 |
72 | # DotCover is a Code Coverage Tool
73 | *.dotCover
74 |
75 | # NCrunch
76 | *.ncrunch*
77 | .*crunch*.local.xml
78 |
79 | # Installshield output folder
80 | [Ee]xpress/
81 |
82 | # DocProject is a documentation generator add-in
83 | DocProject/buildhelp/
84 | DocProject/Help/*.HxT
85 | DocProject/Help/*.HxC
86 | DocProject/Help/*.hhc
87 | DocProject/Help/*.hhk
88 | DocProject/Help/*.hhp
89 | DocProject/Help/Html2
90 | DocProject/Help/html
91 |
92 | # Click-Once directory
93 | publish/
94 |
95 | # Publish Web Output
96 | *.Publish.xml
97 |
98 | # NuGet Packages Directory
99 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
100 | #packages/
101 |
102 | # Windows Azure Build Output
103 | csx
104 | *.build.csdef
105 |
106 | # Windows Store app package directory
107 | AppPackages/
108 |
109 | # Others
110 | sql/
111 | *.Cache
112 | ClientBin/
113 | [Ss]tyle[Cc]op.*
114 | ~$*
115 | *~
116 | *.dbmdl
117 | *.[Pp]ublish.xml
118 | *.pfx
119 | *.publishsettings
120 |
121 | # RIA/Silverlight projects
122 | Generated_Code/
123 |
124 | # Backup & report files from converting an old project file to a newer
125 | # Visual Studio version. Backup files are not needed, because we have git ;-)
126 | _UpgradeReport_Files/
127 | Backup*/
128 | UpgradeLog*.XML
129 | UpgradeLog*.htm
130 |
131 | # SQL Server files
132 | App_Data/*.mdf
133 | App_Data/*.ldf
134 |
135 |
136 | #LightSwitch generated files
137 | GeneratedArtifacts/
138 | _Pvt_Extensions/
139 | ModelManifest.xml
140 |
141 | # =========================
142 | # Windows detritus
143 | # =========================
144 |
145 | # Windows image file caches
146 | Thumbs.db
147 | ehthumbs.db
148 |
149 | # Folder config file
150 | Desktop.ini
151 |
152 | # Recycle Bin used on file shares
153 | $RECYCLE.BIN/
154 |
155 | # Mac desktop service store files
156 | .DS_Store
157 |
--------------------------------------------------------------------------------
/CommonLibrary/CommonLibrary.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {F8D030E9-2CFD-499B-B87F-80F8E2C57AA1}
8 | Library
9 | Properties
10 | CommonLibrary
11 | CommonLibrary
12 | v4.5
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Always
56 |
57 |
58 |
59 |
66 |
--------------------------------------------------------------------------------
/CommonLibrary/Enums/DeviceCap.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CommonLibrary
8 | {
9 | public enum DeviceCap
10 | {
11 | HORZRES = 8,
12 | VERTRES = 10,
13 | LOGPIXELSX = 88,
14 | LOGPIXELSY = 90,
15 | PHYSICALWIDTH = 110,
16 | SCALINGFACTORX = 114,
17 | DESKTOPVERTRES = 117,
18 | DESKTOPHORZRES = 118
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CommonLibrary/LibHelper/ForegroundWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Runtime.InteropServices;
7 | using System.Diagnostics;
8 |
9 | namespace CommonLibrary
10 | {
11 | public class ForegroundWindow
12 | {
13 | [DllImport("User32.dll")]
14 | private static extern bool SetForegroundWindow(IntPtr hWnd);
15 | [DllImport("user32.dll", CharSet = CharSet.Auto)]
16 | static public extern IntPtr GetForegroundWindow();
17 | [DllImport("user32.dll")]
18 | static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo);
19 | [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
20 | private static extern int GetWindowThreadProcessId(IntPtr handle, out int processId);
21 | private void SendCtrlC(IntPtr hWnd)
22 | {
23 | uint KEYEVENTF_KEYUP = 2;
24 | byte VK_CONTROL = 0x11;
25 | //SetForegroundWindow(hWnd);
26 | keybd_event(VK_CONTROL, 0, 0, 0);
27 | keybd_event(0x43, 0, 0, 0); //Send the C key (43 is "C")
28 | keybd_event(0x43, 0, KEYEVENTF_KEYUP, 0);
29 | keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);// 'Left Control Up
30 | }
31 |
32 | /// Returns true if the current application has focus, false otherwise
33 | public static bool ApplicationIsActivated()
34 | {
35 | var activatedHandle = GetForegroundWindow();
36 | if (activatedHandle == IntPtr.Zero)
37 | {
38 | return false; // No window is currently activated
39 | }
40 |
41 | var procId = Process.GetCurrentProcess().Id;
42 | int activeProcId;
43 | GetWindowThreadProcessId(activatedHandle, out activeProcId);
44 | return activeProcId == procId;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/CommonLibrary/LibHelper/HotKeyDllHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Runtime.InteropServices;
7 |
8 | namespace CommonLibrary
9 | {
10 | public class HotKeyDllHelper
11 | {
12 | //加载dll,调用win32API。
13 | [DllImport("user32.dll", SetLastError = true)]
14 | //声明注册快捷键方法,方法实体dll中。参数为窗口句柄,快捷键自定义ID,Ctrl,Shift等功能键,其他按键。
15 | public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
16 | [DllImport("user32.dll", SetLastError = true)]
17 | //注销快捷键方法的声明。
18 | public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CommonLibrary/LibHelper/PrScrnDllHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace CommonLibrary
9 | {
10 | public class PrScrnDllHelper
11 | {
12 | [DllImport("PrScrn.dll", EntryPoint = "PrScrn")]
13 | public static extern int PrScrn();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CommonLibrary/LibHelper/System32DllHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Runtime.InteropServices;
7 | using System.Drawing;
8 |
9 | namespace CommonLibrary
10 | {
11 | [StructLayout(LayoutKind.Sequential)]
12 | public struct CursorInfo
13 | {
14 | public Int32 cbSize;
15 | public Int32 flags;
16 | public IntPtr hCursor;
17 | public Point ptScreenPos;
18 | }
19 |
20 | public class System32DllHelper
21 | {
22 | [DllImport("gdi32.dll", EntryPoint = "GetDeviceCaps", SetLastError = true)]
23 | public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
24 |
25 | private const Int32 CURSOR_SHOWING = 0x00000001;
26 | [DllImport("user32.dll")]
27 | public static extern bool GetCursorInfo(out CursorInfo cursorInfo);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CommonLibrary/PrScrn.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/CommonLibrary/PrScrn.dll
--------------------------------------------------------------------------------
/CommonLibrary/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("CommonLibrary")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CommonLibrary")]
13 | [assembly: AssemblyCopyright("Copyright © 2022")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("11f99303-e3bc-4b32-9540-a9e36d89dcfe")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CommonLibrary/Utils/IniConfigUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace CommonLibrary
10 | {
11 | public class IniConfigUtils
12 | {
13 |
14 |
15 | [DllImport("kernel32")]//返回0表示失败,非0为成功
16 | private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
17 | [DllImport("kernel32")]//返回取得字符串缓冲区的长度
18 | private static extern long GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
19 |
20 | ///
21 | /// 读取ini文件
22 | ///
23 | /// 名称
24 | /// 关键字
25 | /// 默认值
26 | /// ini文件地址
27 | ///
28 | public static string GetValue(string Section, string Key, string defaultText, string iniFilePath)
29 | {
30 | if (File.Exists(iniFilePath))
31 | {
32 | StringBuilder temp = new StringBuilder(1024);
33 | GetPrivateProfileString(Section, Key, defaultText, temp, 1024, iniFilePath);
34 | return temp.ToString();
35 | }
36 | else
37 | {
38 | return defaultText;
39 | }
40 | }
41 |
42 | ///
43 | /// 写入ini文件
44 | ///
45 | /// 名称
46 | /// 关键字
47 | /// 默认值
48 | /// ini文件地址
49 | ///
50 | public static bool SetValue(string Section, string Key, string Value, string iniFilePath)
51 | {
52 | var pat = Path.GetDirectoryName(iniFilePath);
53 | if (Directory.Exists(pat) == false)
54 | {
55 | Directory.CreateDirectory(pat);
56 | }
57 | if (File.Exists(iniFilePath) == false)
58 | {
59 | File.Create(iniFilePath).Close();
60 | }
61 | long OpStation = WritePrivateProfileString(Section, Key, Value, iniFilePath);
62 | if (OpStation == 0)
63 | {
64 | return false;
65 | }
66 | else
67 | {
68 | return true;
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/GIFSicleTool/GIFSicleTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {7E623DA5-9D5A-4A14-91F9-675E37336036}
8 | WinExe
9 | Properties
10 | GIFSicleTool
11 | GIFSicleTool
12 | v4.0
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 | gif_compress.ico
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | Form
52 |
53 |
54 | Form_gif_sicle_tool.cs
55 |
56 |
57 |
58 |
59 | Form_gif_sicle_tool.cs
60 |
61 |
62 | ResXFileCodeGenerator
63 | Resources.Designer.cs
64 | Designer
65 |
66 |
67 | True
68 | Resources.resx
69 | True
70 |
71 |
72 |
73 | SettingsSingleFileGenerator
74 | Settings.Designer.cs
75 |
76 |
77 | True
78 | Settings.settings
79 | True
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
97 |
--------------------------------------------------------------------------------
/GIFSicleTool/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 |
6 | namespace GIFSicleTool
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// 应用程序的主入口点。
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form_gif_sicle_tool());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/GIFSicleTool/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("GIFSicleTool")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("GIFSicleTool")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | //将 ComVisible 设置为 false 将使此程序集中的类型
18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("7e623da5-9d5a-4a14-91f9-675e37336036")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”: :
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/GIFSicleTool/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GIFSicleTool.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GIFSicleTool.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
65 | ///
66 | internal static System.Drawing.Bitmap gif_compress {
67 | get {
68 | object obj = ResourceManager.GetObject("gif_compress", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// 查找 System.Byte[] 类型的本地化资源。
75 | ///
76 | internal static byte[] gifsicle {
77 | get {
78 | object obj = ResourceManager.GetObject("gifsicle", resourceCulture);
79 | return ((byte[])(obj));
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/GIFSicleTool/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\gifsicle.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
125 | ..\Resources\gif_compress.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
--------------------------------------------------------------------------------
/GIFSicleTool/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GIFSicleTool.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
29 | public int Setting_output_mode {
30 | get {
31 | return ((int)(this["Setting_output_mode"]));
32 | }
33 | set {
34 | this["Setting_output_mode"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("")]
41 | public string Setting_output_path {
42 | get {
43 | return ((string)(this["Setting_output_path"]));
44 | }
45 | set {
46 | this["Setting_output_path"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
53 | public bool Setting_is_compress_defult {
54 | get {
55 | return ((bool)(this["Setting_is_compress_defult"]));
56 | }
57 | set {
58 | this["Setting_is_compress_defult"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("2")]
65 | public int Setting_compress_defult_level {
66 | get {
67 | return ((int)(this["Setting_compress_defult_level"]));
68 | }
69 | set {
70 | this["Setting_compress_defult_level"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
77 | public bool Setting_is_compress_scale {
78 | get {
79 | return ((bool)(this["Setting_is_compress_scale"]));
80 | }
81 | set {
82 | this["Setting_is_compress_scale"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("80")]
89 | public int Setting_compress_scale {
90 | get {
91 | return ((int)(this["Setting_compress_scale"]));
92 | }
93 | set {
94 | this["Setting_compress_scale"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
101 | public bool Setting_is_compress_lossy {
102 | get {
103 | return ((bool)(this["Setting_is_compress_lossy"]));
104 | }
105 | set {
106 | this["Setting_is_compress_lossy"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("35")]
113 | public int Setting_compress_lossy {
114 | get {
115 | return ((int)(this["Setting_compress_lossy"]));
116 | }
117 | set {
118 | this["Setting_compress_lossy"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
125 | public bool Setting__is_compress_resize {
126 | get {
127 | return ((bool)(this["Setting__is_compress_resize"]));
128 | }
129 | set {
130 | this["Setting__is_compress_resize"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("")]
137 | public string Setting_compress_resize_width {
138 | get {
139 | return ((string)(this["Setting_compress_resize_width"]));
140 | }
141 | set {
142 | this["Setting_compress_resize_width"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("")]
149 | public string Setting_compress_resize_height {
150 | get {
151 | return ((string)(this["Setting_compress_resize_height"]));
152 | }
153 | set {
154 | this["Setting_compress_resize_height"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
161 | public bool Setting_is_compress_color {
162 | get {
163 | return ((bool)(this["Setting_is_compress_color"]));
164 | }
165 | set {
166 | this["Setting_is_compress_color"] = value;
167 | }
168 | }
169 |
170 | [global::System.Configuration.UserScopedSettingAttribute()]
171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
173 | public int Setting_compress_color_level {
174 | get {
175 | return ((int)(this["Setting_compress_color_level"]));
176 | }
177 | set {
178 | this["Setting_compress_color_level"] = value;
179 | }
180 | }
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/GIFSicleTool/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 0
7 |
8 |
9 |
10 |
11 |
12 | True
13 |
14 |
15 | 2
16 |
17 |
18 | False
19 |
20 |
21 | 80
22 |
23 |
24 | False
25 |
26 |
27 | 35
28 |
29 |
30 | False
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | False
40 |
41 |
42 | 0
43 |
44 |
45 |
--------------------------------------------------------------------------------
/GIFSicleTool/Resources/gif_compress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/GIFSicleTool/Resources/gif_compress.png
--------------------------------------------------------------------------------
/GIFSicleTool/Resources/gifsicle.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/GIFSicleTool/Resources/gifsicle.exe
--------------------------------------------------------------------------------
/GIFSicleTool/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 0
12 |
13 |
14 |
15 |
16 |
17 | True
18 |
19 |
20 | 2
21 |
22 |
23 | False
24 |
25 |
26 | 80
27 |
28 |
29 | False
30 |
31 |
32 | 35
33 |
34 |
35 | False
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | False
45 |
46 |
47 | 0
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/GIFSicleTool/gif_compress.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/GIFSicleTool/gif_compress.ico
--------------------------------------------------------------------------------
/MyScreenTools.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyScreenTools", "MyScreenTools\MyScreenTools.csproj", "{57FBE5AB-F79C-466E-8CFE-7431BD8D1632}"
7 | EndProject
8 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "MyScreenToolsSetup", "MyScreenToolsSetup\MyScreenToolsSetup.vdproj", "{A4839F35-F3C0-4F02-B935-2FDAA6749AF7}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScreenToGif", "ScreenToGif\ScreenToGif.csproj", "{51F5B263-0DF8-46AE-B1BB-A4AF0B12F69F}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScreenColorPicker", "ScreenColorPicker\ScreenColorPicker.csproj", "{272D703B-B7A7-4993-8690-23390223D736}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonLibrary", "CommonLibrary\CommonLibrary.csproj", "{F8D030E9-2CFD-499B-B87F-80F8E2C57AA1}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GIFSicleTool", "GIFSicleTool\GIFSicleTool.csproj", "{7E623DA5-9D5A-4A14-91F9-675E37336036}"
17 | EndProject
18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScreenTextPaster", "ScreenTextPaster\ScreenTextPaster.csproj", "{DC7A057B-8C57-45C8-B3E6-9F1BBF061BCC}"
19 | EndProject
20 | Global
21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 | Debug|Any CPU = Debug|Any CPU
23 | Release|Any CPU = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
26 | {57FBE5AB-F79C-466E-8CFE-7431BD8D1632}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {57FBE5AB-F79C-466E-8CFE-7431BD8D1632}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {57FBE5AB-F79C-466E-8CFE-7431BD8D1632}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {57FBE5AB-F79C-466E-8CFE-7431BD8D1632}.Release|Any CPU.Build.0 = Release|Any CPU
30 | {A4839F35-F3C0-4F02-B935-2FDAA6749AF7}.Debug|Any CPU.ActiveCfg = Debug
31 | {A4839F35-F3C0-4F02-B935-2FDAA6749AF7}.Release|Any CPU.ActiveCfg = Release
32 | {51F5B263-0DF8-46AE-B1BB-A4AF0B12F69F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {51F5B263-0DF8-46AE-B1BB-A4AF0B12F69F}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {51F5B263-0DF8-46AE-B1BB-A4AF0B12F69F}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {51F5B263-0DF8-46AE-B1BB-A4AF0B12F69F}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {272D703B-B7A7-4993-8690-23390223D736}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {272D703B-B7A7-4993-8690-23390223D736}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {272D703B-B7A7-4993-8690-23390223D736}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {272D703B-B7A7-4993-8690-23390223D736}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {F8D030E9-2CFD-499B-B87F-80F8E2C57AA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {F8D030E9-2CFD-499B-B87F-80F8E2C57AA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {F8D030E9-2CFD-499B-B87F-80F8E2C57AA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {F8D030E9-2CFD-499B-B87F-80F8E2C57AA1}.Release|Any CPU.Build.0 = Release|Any CPU
44 | {7E623DA5-9D5A-4A14-91F9-675E37336036}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {7E623DA5-9D5A-4A14-91F9-675E37336036}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {7E623DA5-9D5A-4A14-91F9-675E37336036}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {7E623DA5-9D5A-4A14-91F9-675E37336036}.Release|Any CPU.Build.0 = Release|Any CPU
48 | {DC7A057B-8C57-45C8-B3E6-9F1BBF061BCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49 | {DC7A057B-8C57-45C8-B3E6-9F1BBF061BCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
50 | {DC7A057B-8C57-45C8-B3E6-9F1BBF061BCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 | {DC7A057B-8C57-45C8-B3E6-9F1BBF061BCC}.Release|Any CPU.Build.0 = Release|Any CPU
52 | EndGlobalSection
53 | GlobalSection(SolutionProperties) = preSolution
54 | HideSolutionNode = FALSE
55 | EndGlobalSection
56 | EndGlobal
57 |
--------------------------------------------------------------------------------
/MyScreenTools/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | <屏幕工具.Properties.Settings>
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 90
21 |
22 |
23 | 67
24 |
25 |
26 | 0
27 |
28 |
29 | 0
30 |
31 |
32 | False
33 |
34 |
35 | False
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | 0
45 |
46 |
47 | False
48 |
49 |
50 | 88
51 |
52 |
53 | 86
54 |
55 |
56 | False
57 |
58 | 屏幕工具.Properties.Settings>
59 |
60 |
--------------------------------------------------------------------------------
/MyScreenTools/App.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/App.ico
--------------------------------------------------------------------------------
/MyScreenTools/Bean/DictionaryMeansBean.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace 屏幕工具.Bean
4 | {
5 | public class DictionaryMeansBean
6 | {
7 | ///
8 | ///
9 | ///
10 | [JsonProperty("word_result")]
11 | public WordResult WordResult { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/OcrBasicBean.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Collections.Generic;
7 | using Newtonsoft.Json;
8 |
9 | namespace 屏幕工具.Bean
10 | {
11 | class OcrBasicBean
12 | {
13 | ///
14 | ///
15 | ///
16 | [JsonProperty("words_result")]
17 | public List WordsResult { get; set; }
18 |
19 | ///
20 | ///
21 | ///
22 | [JsonProperty("words_result_num")]
23 | public int WordsResultNum { get; set; }
24 |
25 | ///
26 | ///
27 | ///
28 | [JsonProperty("log_id")]
29 | public long LogId { get; set; }
30 |
31 | ///
32 | ///
33 | ///
34 | [JsonProperty("error_code")]
35 | public int ErrorCode { get; set; }
36 |
37 | ///
38 | ///
39 | ///
40 | [JsonProperty("error_msg")]
41 | public string ErrorMsg { get; set; }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/MyScreenTools/Bean/OcrExcelBean.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace 屏幕工具.Bean
8 | {
9 | public class Vertexes_locationItem
10 | {
11 | public int x { get; set; }
12 | public int y { get; set; }
13 | }
14 | public class BodyItem
15 | {
16 | public int column { get; set; }
17 | public double probability { get; set; }
18 | public int row { get; set; }
19 | public List vertexes_location { get; set; }
20 | public string words { get; set; } //目
21 | }
22 | public class FooterItem
23 | {
24 | public int column { get; set; }
25 | public double probability { get; set; }
26 | public int row { get; set; }
27 | public List vertexes_location { get; set; }
28 | public string words { get; set; }
29 | }
30 | public class HeaderItem
31 | {
32 | public int column { get; set; }
33 | public double probability { get; set; }
34 | public int row { get; set; }
35 | public List vertexes_location { get; set; }
36 | public string words { get; set; } //29月
37 | }
38 | public class Forms_resultItem
39 | {
40 | public List body { get; set; }
41 | public List footer { get; set; }
42 | public List header { get; set; }
43 | public List vertexes_location { get; set; }
44 | }
45 | public class OcrExcelBean
46 | {
47 | public long log_id { get; set; }
48 | public int forms_result_num { get; set; }
49 | public List forms_result { get; set; }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/MyScreenTools/Bean/Result.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Newtonsoft.Json;
3 |
4 | namespace 屏幕工具.Bean
5 | {
6 | public class Result
7 | {
8 | ///
9 | ///
10 | ///
11 | [JsonProperty("from")]
12 | public string From { get; set; }
13 |
14 | ///
15 | ///
16 | ///
17 | [JsonProperty("trans_result")]
18 | public List TransResult { get; set; }
19 |
20 | ///
21 | ///
22 | ///
23 | [JsonProperty("to")]
24 | public string To { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/Result2.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Newtonsoft.Json;
3 |
4 | namespace 屏幕工具.Bean
5 | {
6 | public class Result2
7 | {
8 | ///
9 | ///
10 | ///
11 | [JsonProperty("from")]
12 | public string From { get; set; }
13 |
14 | ///
15 | ///
16 | ///
17 | [JsonProperty("trans_result")]
18 | public List TransResult { get; set; }
19 |
20 | ///
21 | ///
22 | ///
23 | [JsonProperty("to")]
24 | public string To { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/SimpleMeans.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Newtonsoft.Json;
3 |
4 | namespace 屏幕工具.Bean
5 | {
6 | public class SimpleMeans
7 | {
8 | ///
9 | ///
10 | ///
11 | [JsonProperty("word_means")]
12 | public List WordMeans { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/TextTranslateBasicBean.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace 屏幕工具.Bean
4 | {
5 | public class TextTranslateBasicBean
6 | {
7 | ///
8 | ///
9 | ///
10 | [JsonProperty("result")]
11 | public Result Result { get; set; }
12 |
13 | ///
14 | ///
15 | ///
16 | [JsonProperty("log_id")]
17 | public long LogId { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/TextTranslateDictionaryBean.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace 屏幕工具.Bean
4 | {
5 | public class TextTranslateDictionaryBean
6 | {
7 | ///
8 | ///
9 | ///
10 | [JsonProperty("result")]
11 | public Result2 Result { get; set; }
12 |
13 | ///
14 | ///
15 | ///
16 | [JsonProperty("log_id")]
17 | public long LogId { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/TransResultItem.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace 屏幕工具.Bean
4 | {
5 | public class TransResultItem
6 | {
7 | ///
8 | /// 你好,纽约
9 | ///
10 | [JsonProperty("dst")]
11 | public string Dst { get; set; }
12 |
13 | ///
14 | ///
15 | ///
16 | [JsonProperty("src")]
17 | public string Src { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/TransResultItem2.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace 屏幕工具.Bean
4 | {
5 | public class TransResultItem2
6 | {
7 | ///
8 | ///
9 | ///
10 | [JsonProperty("src_tts")]
11 | public string SrcTts { get; set; }
12 |
13 | ///
14 | ///
15 | ///
16 | [JsonProperty("dict")]
17 | public string Dict { get; set; }
18 |
19 | ///
20 | ///
21 | ///
22 | [JsonProperty("dst")]
23 | public string Dst { get; set; }
24 |
25 | ///
26 | ///
27 | ///
28 | [JsonProperty("dst_tts")]
29 | public string DstTts { get; set; }
30 |
31 | ///
32 | /// 清除
33 | ///
34 | [JsonProperty("src")]
35 | public string Src { get; set; }
36 | }
37 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/WordResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace 屏幕工具.Bean
4 | {
5 | public class WordResult
6 | {
7 | ///
8 | ///
9 | ///
10 | [JsonProperty("simple_means")]
11 | public SimpleMeans SimpleMeans { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/MyScreenTools/Bean/WordsResultItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Newtonsoft.Json;
7 |
8 | namespace 屏幕工具.Bean
9 | {
10 | class WordsResultItem
11 | {
12 | ///
13 | /// //图片文件路径
14 | ///
15 | [JsonProperty("words")]
16 | public string Words { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/MyScreenTools/Enums/BaiduYunType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace 屏幕工具
8 | {
9 | // 截图类型
10 | public enum BaiduYunType
11 | {
12 | OCR, TRANSLATE
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MyScreenTools/Enums/CatchType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace 屏幕工具
8 | {
9 | // 截图类型
10 | public enum CatchType
11 | {
12 | CATCH, OCR_BASIC, PASTE, OCR_EXCEL
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MyScreenTools/Libs/AipSdk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Libs/AipSdk.dll
--------------------------------------------------------------------------------
/MyScreenTools/Libs/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Libs/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/MyScreenTools/Libs/System.Net.Http.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Libs/System.Net.Http.dll
--------------------------------------------------------------------------------
/MyScreenTools/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Runtime.InteropServices;
7 | using System.Threading;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace 屏幕工具
12 | {
13 | static class Program
14 | {
15 | ///
16 | /// 应用程序的主入口点。
17 | ///
18 | [STAThread]
19 | static void Main()
20 | {
21 | ////////////// 判断程序是否已经运行方法一 ///////////////
22 | //bool bCanRun = false;
23 | //Mutex mutex = new Mutex(true, "OnlyOne", out bCanRun);
24 | //if (!bCanRun)
25 | //{
26 | // MessageBox.Show("不可重复启动!");
27 | // return;
28 | //}
29 |
30 | ////////////// 判断程序是否已经运行方法二 ///////////////
31 | Process instance = RunningInstance();
32 | if (instance == null)
33 | {
34 | Application.EnableVisualStyles();
35 | Application.SetCompatibleTextRenderingDefault(false);
36 | Application.Run(new Form_main());
37 | }
38 | else
39 | {
40 | MessageBox.Show("已经运行了");
41 | HandleRunningInstance(instance);
42 | }
43 |
44 | /******************************************** 让程序以管理员身份运行 *********************************************/
45 | ////当前用户是管理员的时候,直接启动应用程序;如果不是管理员,则使用启动对象启动程序,以确保使用管理员身份运行
46 | ////获得当前登录的Windows用户标示
47 | //System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();
48 | //System.Security.Principal.WindowsPrincipal principal = new System.Security.Principal.WindowsPrincipal(identity);
49 | ////判断当前登录用户是否为管理员,如果是管理员,则直接运行
50 | //if (principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator))
51 | //{
52 | // Application.Run(new Form_main());
53 | //}
54 | //else
55 | //{
56 | // //创建启动对象
57 | // System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
58 | // startInfo.UseShellExecute = true;
59 | // startInfo.WorkingDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
60 | // startInfo.FileName = Application.ExecutablePath;
61 | // //设置启动动作,确保以管理员身份运行
62 | // startInfo.Verb = "runas";
63 | // try
64 | // {
65 | // System.Diagnostics.Process.Start(startInfo);
66 | // }
67 | // catch
68 | // {
69 | // return;
70 | // }
71 | //}
72 |
73 | }
74 |
75 | #region 防止重复运行
76 | public static Process RunningInstance()
77 | {
78 |
79 | Process current = Process.GetCurrentProcess();
80 | Process[] processes = Process.GetProcessesByName(current.ProcessName);
81 | foreach (Process process in processes)
82 | {
83 | if (process.Id != current.Id)
84 | {
85 | if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == current.MainModule.FileName)
86 | {
87 | return process;
88 | }
89 | }
90 | }
91 | return null;
92 | }
93 | public static void HandleRunningInstance(Process instance)
94 | {
95 | ShowWindowAsync(instance.MainWindowHandle, WS_SHOWNORMAL);
96 | SetForegroundWindow(instance.MainWindowHandle);
97 | }
98 | [DllImport("User32.dll")]
99 | private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
100 | [DllImport("User32.dll")]
101 | private static extern bool SetForegroundWindow(IntPtr hWnd);
102 | private const int WS_SHOWNORMAL = 1;
103 | #endregion
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/MyScreenTools/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("屏幕工具")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("屏幕工具")]
13 | [assembly: AssemblyCopyright("Copyright © 2022")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("1bbf8e0d-1ed6-4ed0-83f4-a8d878c12ef1")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("2.2.1.0")]
36 | [assembly: AssemblyFileVersion("2.2.1.0")]
37 |
--------------------------------------------------------------------------------
/MyScreenTools/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace 屏幕工具.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string OCRApiKey {
30 | get {
31 | return ((string)(this["OCRApiKey"]));
32 | }
33 | set {
34 | this["OCRApiKey"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("")]
41 | public string OCRSecretKey {
42 | get {
43 | return ((string)(this["OCRSecretKey"]));
44 | }
45 | set {
46 | this["OCRSecretKey"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("90")]
53 | public int CatchHotKey {
54 | get {
55 | return ((int)(this["CatchHotKey"]));
56 | }
57 | set {
58 | this["CatchHotKey"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("67")]
65 | public int OcrBasicHotKey {
66 | get {
67 | return ((int)(this["OcrBasicHotKey"]));
68 | }
69 | set {
70 | this["OcrBasicHotKey"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
77 | public int TranslateFrom {
78 | get {
79 | return ((int)(this["TranslateFrom"]));
80 | }
81 | set {
82 | this["TranslateFrom"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
89 | public int TranslateTo {
90 | get {
91 | return ((int)(this["TranslateTo"]));
92 | }
93 | set {
94 | this["TranslateTo"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
101 | public bool TranslateAuto {
102 | get {
103 | return ((bool)(this["TranslateAuto"]));
104 | }
105 | set {
106 | this["TranslateAuto"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
113 | public bool TranslateDrag {
114 | get {
115 | return ((bool)(this["TranslateDrag"]));
116 | }
117 | set {
118 | this["TranslateDrag"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("")]
125 | public string TranslateApiKey {
126 | get {
127 | return ((string)(this["TranslateApiKey"]));
128 | }
129 | set {
130 | this["TranslateApiKey"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("")]
137 | public string TranslateSecretKey {
138 | get {
139 | return ((string)(this["TranslateSecretKey"]));
140 | }
141 | set {
142 | this["TranslateSecretKey"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
149 | public int TranslateType {
150 | get {
151 | return ((int)(this["TranslateType"]));
152 | }
153 | set {
154 | this["TranslateType"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
161 | public bool AutoStart {
162 | get {
163 | return ((bool)(this["AutoStart"]));
164 | }
165 | set {
166 | this["AutoStart"] = value;
167 | }
168 | }
169 |
170 | [global::System.Configuration.UserScopedSettingAttribute()]
171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 | [global::System.Configuration.DefaultSettingValueAttribute("88")]
173 | public int PasteHotKey {
174 | get {
175 | return ((int)(this["PasteHotKey"]));
176 | }
177 | set {
178 | this["PasteHotKey"] = value;
179 | }
180 | }
181 |
182 | [global::System.Configuration.UserScopedSettingAttribute()]
183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
184 | [global::System.Configuration.DefaultSettingValueAttribute("86")]
185 | public int OcrExcelHotKey {
186 | get {
187 | return ((int)(this["OcrExcelHotKey"]));
188 | }
189 | set {
190 | this["OcrExcelHotKey"] = value;
191 | }
192 | }
193 |
194 | [global::System.Configuration.UserScopedSettingAttribute()]
195 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
196 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
197 | public bool CopyImagePath {
198 | get {
199 | return ((bool)(this["CopyImagePath"]));
200 | }
201 | set {
202 | this["CopyImagePath"] = value;
203 | }
204 | }
205 | }
206 | }
207 |
--------------------------------------------------------------------------------
/MyScreenTools/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 90
13 |
14 |
15 | 67
16 |
17 |
18 | 0
19 |
20 |
21 | 0
22 |
23 |
24 | False
25 |
26 |
27 | False
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 0
37 |
38 |
39 | False
40 |
41 |
42 | 88
43 |
44 |
45 | 86
46 |
47 |
48 | False
49 |
50 |
51 |
--------------------------------------------------------------------------------
/MyScreenTools/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
54 |
--------------------------------------------------------------------------------
/MyScreenTools/Readme.txt:
--------------------------------------------------------------------------------
1 | ********************************************************************************
2 | * 屏幕工具程序版本说明 *
3 | ********************************************************************************
4 |
5 | /******************************************************************************/
6 | 版本号:2.2.1.0
7 | 升级人员:Lois
8 | 修改日期:2022-12-26
9 | 功能:
10 | 1、修改贴图窗口置顶;
11 | 2、增加百度云设置自动加载配置文件功能;
12 | 3、增加截图复制图像内容或路径选项设置;
13 | 4、增加帖文字功能;
14 |
15 | /******************************************************************************/
16 | 版本号:2.2.0.0
17 | 升级人员:Lois
18 | 修改日期:2022-10-27
19 | 功能:
20 | 1、增加GIF压缩功能;
21 | 2、修复界面最小化不能显示问题;
22 | 3、修复GIF录制在放大屏幕上鼠标位置不准问题;
23 |
24 | /******************************************************************************/
25 | 版本号:2.1.0.0
26 | 升级人员:Lois
27 | 修改日期:2022-10-16
28 | 功能:
29 | 1、将屏幕取色功能独立成单独模块;
30 | 2、新增GIF截屏功能单独模块;
31 |
32 | /******************************************************************************/
33 | 版本号:2.0.1.1
34 | 升级人员:Lois
35 | 修改日期:2022-08-22
36 | 功能:
37 | 1、修复开机启动截图保存失败问题;
38 |
39 | /******************************************************************************/
40 | 版本号:2.0.1.0
41 | 升级人员:Lois
42 | 修改日期:2022-08-17
43 | 功能:
44 | 1、增加贴图功能;
45 | 2、增加表格识别功能;
46 | 3、增加开机启动设置功能;
47 |
48 | /******************************************************************************/
49 | 版本号:2.0.0.1
50 | 升级人员:Lois
51 | 修改日期:2022-04-24
52 | 功能:
53 | 1、修复自动识别中英文和截图本程序窗口不隐藏问题;
54 |
55 | /******************************************************************************/
56 | 版本号:2.0.0.0
57 | 升级人员:Lois
58 | 修改日期:2022-04-23
59 | 功能:
60 | 1、增加句子翻译和词典翻译功能;
61 |
62 | /******************************************************************************/
63 | 版本号:1.0.0.0
64 | 升级人员:Lois
65 | 修改日期:2022-04-19
66 | 功能:
67 | 1、截图+快捷键截图;
68 | 2、文字识别+快捷键文字识别;
69 | 3、屏幕颜色提取+快捷键屏幕颜色提取;
70 | 4、翻译+划词翻译;
71 |
72 |
--------------------------------------------------------------------------------
/MyScreenTools/Resources/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/bg.jpg
--------------------------------------------------------------------------------
/MyScreenTools/Resources/ocr_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/ocr_128.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/ocr_200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/ocr_200.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/ocr_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/ocr_48.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/ocr_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/ocr_64.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/下载.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/下载.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/关于软件.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/关于软件.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/取消 .png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/取消 .png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/快捷键.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/快捷键.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/打开.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/打开.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/确认.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/确认.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/网站账号.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/网站账号.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/设置.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/设置.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/选择框-未选.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/选择框-未选.png
--------------------------------------------------------------------------------
/MyScreenTools/Resources/选择框_选中.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/Resources/选择框_选中.png
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_about.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.IO;
11 |
12 | namespace 屏幕工具
13 | {
14 | public partial class Form_about : Form
15 | {
16 | public Form_about()
17 | {
18 | InitializeComponent();
19 | lb_version.Text = "V" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
20 | lb_author.Text = "Lois(QQ:234808404)";
21 | string path = System.AppDomain.CurrentDomain.BaseDirectory + "\\Readme.txt";
22 | StreamReader sr = new StreamReader(path, Encoding.Default);
23 | string content;
24 | while ((content = sr.ReadLine()) != null)
25 | {
26 | tb_version_log.Text += content + "\r\n";
27 | }
28 | tb_version_log.Focus();
29 | tb_version_log.SelectionStart = 0; //设置起始位置
30 | tb_version_log.SelectionLength = 0; //设置长度
31 | tb_version_log.ScrollToCaret();
32 | }
33 |
34 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
35 | {
36 | System.Diagnostics.Process.Start("https://blog.csdn.net/loutengyuan/article/details/125669369");
37 | }
38 |
39 | private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
40 | {
41 | System.Diagnostics.Process.Start("https://github.com/luotengyuan/MyScreenTools");
42 | }
43 |
44 | private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
45 | {
46 | System.Diagnostics.Process.Start("https://gitee.com/luotengyuan/MyScreenTools");
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_baiduyun.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 屏幕工具
2 | {
3 | partial class Form_baiduyun
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_baiduyun));
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.tb_api_key = new System.Windows.Forms.TextBox();
35 | this.tb_secret_key = new System.Windows.Forms.TextBox();
36 | this.btn_set = new System.Windows.Forms.Button();
37 | this.ll_baiduyun = new System.Windows.Forms.LinkLabel();
38 | this.label3 = new System.Windows.Forms.Label();
39 | this.groupBox = new System.Windows.Forms.GroupBox();
40 | this.groupBox.SuspendLayout();
41 | this.SuspendLayout();
42 | //
43 | // label1
44 | //
45 | this.label1.AutoSize = true;
46 | this.label1.Location = new System.Drawing.Point(57, 26);
47 | this.label1.Name = "label1";
48 | this.label1.Size = new System.Drawing.Size(53, 12);
49 | this.label1.TabIndex = 0;
50 | this.label1.Text = "ApiKey:";
51 | //
52 | // label2
53 | //
54 | this.label2.AutoSize = true;
55 | this.label2.Location = new System.Drawing.Point(39, 53);
56 | this.label2.Name = "label2";
57 | this.label2.Size = new System.Drawing.Size(71, 12);
58 | this.label2.TabIndex = 1;
59 | this.label2.Text = "SecretKry:";
60 | //
61 | // tb_api_key
62 | //
63 | this.tb_api_key.Location = new System.Drawing.Point(116, 23);
64 | this.tb_api_key.Name = "tb_api_key";
65 | this.tb_api_key.Size = new System.Drawing.Size(289, 21);
66 | this.tb_api_key.TabIndex = 2;
67 | //
68 | // tb_secret_key
69 | //
70 | this.tb_secret_key.Location = new System.Drawing.Point(116, 50);
71 | this.tb_secret_key.Name = "tb_secret_key";
72 | this.tb_secret_key.Size = new System.Drawing.Size(289, 21);
73 | this.tb_secret_key.TabIndex = 3;
74 | //
75 | // btn_set
76 | //
77 | this.btn_set.Location = new System.Drawing.Point(41, 86);
78 | this.btn_set.Name = "btn_set";
79 | this.btn_set.Size = new System.Drawing.Size(392, 27);
80 | this.btn_set.TabIndex = 4;
81 | this.btn_set.Text = "设置";
82 | this.btn_set.UseVisualStyleBackColor = true;
83 | this.btn_set.Click += new System.EventHandler(this.btn_set_Click);
84 | //
85 | // ll_baiduyun
86 | //
87 | this.ll_baiduyun.AutoSize = true;
88 | this.ll_baiduyun.LinkColor = System.Drawing.Color.Red;
89 | this.ll_baiduyun.Location = new System.Drawing.Point(86, 166);
90 | this.ll_baiduyun.Name = "ll_baiduyun";
91 | this.ll_baiduyun.Size = new System.Drawing.Size(359, 12);
92 | this.ll_baiduyun.TabIndex = 5;
93 | this.ll_baiduyun.TabStop = true;
94 | this.ll_baiduyun.Text = "如何注册和开通百度云账号以及申请APIKey和SecretKey请点击这里";
95 | this.ll_baiduyun.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ll_baiduyun_LinkClicked);
96 | //
97 | // label3
98 | //
99 | this.label3.AutoSize = true;
100 | this.label3.Location = new System.Drawing.Point(37, 166);
101 | this.label3.Name = "label3";
102 | this.label3.Size = new System.Drawing.Size(41, 12);
103 | this.label3.TabIndex = 6;
104 | this.label3.Text = "提示:";
105 | //
106 | // groupBox
107 | //
108 | this.groupBox.Controls.Add(this.tb_secret_key);
109 | this.groupBox.Controls.Add(this.label1);
110 | this.groupBox.Controls.Add(this.label2);
111 | this.groupBox.Controls.Add(this.btn_set);
112 | this.groupBox.Controls.Add(this.tb_api_key);
113 | this.groupBox.Location = new System.Drawing.Point(12, 12);
114 | this.groupBox.Name = "groupBox";
115 | this.groupBox.Size = new System.Drawing.Size(470, 139);
116 | this.groupBox.TabIndex = 7;
117 | this.groupBox.TabStop = false;
118 | this.groupBox.Text = "百度云图像文字识别";
119 | //
120 | // Form_baiduyun
121 | //
122 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
123 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
124 | this.ClientSize = new System.Drawing.Size(493, 200);
125 | this.Controls.Add(this.groupBox);
126 | this.Controls.Add(this.label3);
127 | this.Controls.Add(this.ll_baiduyun);
128 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
129 | this.MaximizeBox = false;
130 | this.Name = "Form_baiduyun";
131 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
132 | this.Text = "百度云设置";
133 | this.Load += new System.EventHandler(this.Form_baiduyun_Load);
134 | this.groupBox.ResumeLayout(false);
135 | this.groupBox.PerformLayout();
136 | this.ResumeLayout(false);
137 | this.PerformLayout();
138 |
139 | }
140 |
141 | #endregion
142 |
143 | private System.Windows.Forms.Label label1;
144 | private System.Windows.Forms.Label label2;
145 | private System.Windows.Forms.TextBox tb_api_key;
146 | private System.Windows.Forms.TextBox tb_secret_key;
147 | private System.Windows.Forms.Button btn_set;
148 | private System.Windows.Forms.LinkLabel ll_baiduyun;
149 | private System.Windows.Forms.Label label3;
150 | private System.Windows.Forms.GroupBox groupBox;
151 | }
152 | }
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_baiduyun.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.Diagnostics;
11 |
12 | namespace 屏幕工具
13 | {
14 | public partial class Form_baiduyun : Form
15 | {
16 | private BaiduYunType mType;
17 | public Form_baiduyun(BaiduYunType type)
18 | {
19 | this.mType = type;
20 | InitializeComponent();
21 | }
22 |
23 | private void Form_baiduyun_Load(object sender, EventArgs e)
24 | {
25 | if (mType == BaiduYunType.OCR)
26 | {
27 | groupBox.Text = "百度图像云文字识别";
28 | string apiKey = Properties.Settings.Default.OCRApiKey;
29 | string secretKey = Properties.Settings.Default.OCRSecretKey;
30 | if (apiKey != null && apiKey.Length > 0 && secretKey != null && secretKey.Length > 0)
31 | {
32 | tb_api_key.Text = apiKey;
33 | tb_secret_key.Text = secretKey;
34 | }
35 | }
36 | else
37 | {
38 | groupBox.Text = "百度机器翻译";
39 | string apiKey_translate = Properties.Settings.Default.TranslateApiKey;
40 | string secretKey_translate = Properties.Settings.Default.TranslateSecretKey;
41 | if (apiKey_translate != null && apiKey_translate.Length > 0 && secretKey_translate != null && secretKey_translate.Length > 0)
42 | {
43 | tb_api_key.Text = apiKey_translate;
44 | tb_secret_key.Text = secretKey_translate;
45 | }
46 | }
47 | }
48 |
49 | private void btn_set_Click(object sender, EventArgs e)
50 | {
51 | if (mType == BaiduYunType.OCR)
52 | {
53 | string apiKey = tb_api_key.Text.Trim();
54 | string secretKey = tb_secret_key.Text.Trim();
55 | if (apiKey != null && apiKey.Length > 0 && secretKey != null && secretKey.Length > 0)
56 | {
57 | Properties.Settings.Default.OCRApiKey = apiKey;
58 | Properties.Settings.Default.OCRSecretKey = secretKey;
59 | Properties.Settings.Default.Save();
60 | this.DialogResult = DialogResult.OK;
61 | MessageBox.Show("设置成功");
62 | }
63 | else
64 | {
65 | MessageBox.Show("请输入正确的Key信息");
66 | }
67 | }
68 | else
69 | {
70 | string apiKey = tb_api_key.Text.Trim();
71 | string secretKey = tb_secret_key.Text.Trim();
72 | if (apiKey != null && apiKey.Length > 0 && secretKey != null && secretKey.Length > 0)
73 | {
74 | Properties.Settings.Default.TranslateApiKey = apiKey;
75 | Properties.Settings.Default.TranslateSecretKey = secretKey;
76 | Properties.Settings.Default.Save();
77 | this.DialogResult = DialogResult.OK;
78 | MessageBox.Show("设置成功");
79 | }
80 | else
81 | {
82 | MessageBox.Show("请输入正确的Key信息");
83 | }
84 | }
85 | }
86 |
87 | private void ll_baiduyun_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
88 | {
89 | Process.Start("https://luotengyuan.notion.site/OCR-APIKey-SecretKey-a4ae1949601f44d1a5ef67065f56eb11");
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_catch.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 屏幕工具
2 | {
3 | partial class Form_catch
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_catch));
32 | this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
33 | this.btn_confirm = new System.Windows.Forms.Button();
34 | this.btn_cancel = new System.Windows.Forms.Button();
35 | this.btn_dowload = new System.Windows.Forms.Button();
36 | this.panel_menu = new System.Windows.Forms.Panel();
37 | this.panel_menu.SuspendLayout();
38 | this.SuspendLayout();
39 | //
40 | // saveFileDialog1
41 | //
42 | this.saveFileDialog1.Filter = "png文件|*.png|jpg文件|*.jpg";
43 | this.saveFileDialog1.Title = "保存截图";
44 | //
45 | // btn_confirm
46 | //
47 | this.btn_confirm.BackgroundImage = global::屏幕工具.Properties.Resources.确认;
48 | this.btn_confirm.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
49 | this.btn_confirm.FlatAppearance.BorderSize = 0;
50 | this.btn_confirm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
51 | this.btn_confirm.Location = new System.Drawing.Point(80, 5);
52 | this.btn_confirm.Name = "btn_confirm";
53 | this.btn_confirm.Size = new System.Drawing.Size(30, 23);
54 | this.btn_confirm.TabIndex = 0;
55 | this.btn_confirm.UseVisualStyleBackColor = true;
56 | this.btn_confirm.Click += new System.EventHandler(this.btn_confirm_Click);
57 | //
58 | // btn_cancel
59 | //
60 | this.btn_cancel.BackgroundImage = global::屏幕工具.Properties.Resources.取消;
61 | this.btn_cancel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
62 | this.btn_cancel.FlatAppearance.BorderSize = 0;
63 | this.btn_cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
64 | this.btn_cancel.Location = new System.Drawing.Point(47, 5);
65 | this.btn_cancel.Name = "btn_cancel";
66 | this.btn_cancel.Size = new System.Drawing.Size(30, 23);
67 | this.btn_cancel.TabIndex = 1;
68 | this.btn_cancel.UseVisualStyleBackColor = true;
69 | this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);
70 | //
71 | // btn_dowload
72 | //
73 | this.btn_dowload.BackColor = System.Drawing.Color.Transparent;
74 | this.btn_dowload.BackgroundImage = global::屏幕工具.Properties.Resources.下载;
75 | this.btn_dowload.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
76 | this.btn_dowload.FlatAppearance.BorderSize = 0;
77 | this.btn_dowload.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
78 | this.btn_dowload.Location = new System.Drawing.Point(13, 3);
79 | this.btn_dowload.Name = "btn_dowload";
80 | this.btn_dowload.Size = new System.Drawing.Size(25, 27);
81 | this.btn_dowload.TabIndex = 2;
82 | this.btn_dowload.UseVisualStyleBackColor = false;
83 | this.btn_dowload.Click += new System.EventHandler(this.btn_dowload_Click);
84 | //
85 | // panel_menu
86 | //
87 | this.panel_menu.AutoSize = true;
88 | this.panel_menu.BackColor = System.Drawing.Color.White;
89 | this.panel_menu.Controls.Add(this.btn_dowload);
90 | this.panel_menu.Controls.Add(this.btn_cancel);
91 | this.panel_menu.Controls.Add(this.btn_confirm);
92 | this.panel_menu.Location = new System.Drawing.Point(12, 12);
93 | this.panel_menu.Name = "panel_menu";
94 | this.panel_menu.Size = new System.Drawing.Size(119, 34);
95 | this.panel_menu.TabIndex = 1;
96 | this.panel_menu.Visible = false;
97 | //
98 | // Form_catch
99 | //
100 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
101 | this.BackgroundImage = global::屏幕工具.Properties.Resources.bg;
102 | this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
103 | this.ClientSize = new System.Drawing.Size(772, 556);
104 | this.Controls.Add(this.panel_menu);
105 | this.DoubleBuffered = true;
106 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
107 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
108 | this.Name = "Form_catch";
109 | this.ShowInTaskbar = false;
110 | this.Text = "截图";
111 | this.TopMost = true;
112 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
113 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form_catch_FormClosing);
114 | this.Load += new System.EventHandler(this.Form_catch_Load);
115 | this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form_catch_KeyDown);
116 | this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form_catch_MouseClick);
117 | this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Form_catch_MouseDoubleClick);
118 | this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form_catch_MouseDown);
119 | this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form_catch_MouseMove);
120 | this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form_catch_MouseUp);
121 | this.panel_menu.ResumeLayout(false);
122 | this.ResumeLayout(false);
123 | this.PerformLayout();
124 |
125 | }
126 |
127 | #endregion
128 |
129 | private System.Windows.Forms.SaveFileDialog saveFileDialog1;
130 | private System.Windows.Forms.Button btn_dowload;
131 | private System.Windows.Forms.Button btn_cancel;
132 | private System.Windows.Forms.Button btn_confirm;
133 | private System.Windows.Forms.Panel panel_menu;
134 | }
135 | }
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_paste.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 屏幕工具
2 | {
3 | partial class Form_paste
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.picture_paste = new System.Windows.Forms.PictureBox();
32 | ((System.ComponentModel.ISupportInitialize)(this.picture_paste)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // picture_paste
36 | //
37 | this.picture_paste.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
38 | | System.Windows.Forms.AnchorStyles.Left)
39 | | System.Windows.Forms.AnchorStyles.Right)));
40 | this.picture_paste.Location = new System.Drawing.Point(-1, -1);
41 | this.picture_paste.Name = "picture_paste";
42 | this.picture_paste.Size = new System.Drawing.Size(697, 436);
43 | this.picture_paste.TabIndex = 0;
44 | this.picture_paste.TabStop = false;
45 | //
46 | // Form_paste
47 | //
48 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
49 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
50 | this.ClientSize = new System.Drawing.Size(697, 436);
51 | this.Controls.Add(this.picture_paste);
52 | this.Name = "Form_paste";
53 | this.ShowIcon = false;
54 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
55 | this.Text = "贴图";
56 | this.TopMost = true;
57 | ((System.ComponentModel.ISupportInitialize)(this.picture_paste)).EndInit();
58 | this.ResumeLayout(false);
59 |
60 | }
61 |
62 | #endregion
63 |
64 | private System.Windows.Forms.PictureBox picture_paste;
65 | }
66 | }
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_paste.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.IO;
11 |
12 | namespace 屏幕工具
13 | {
14 | public partial class Form_paste : Form
15 | {
16 | public Form_paste(string path, Rectangle rect)
17 | {
18 | InitializeComponent();
19 | this.Width = rect.Width + 20;
20 | this.Height = rect.Height + SystemInformation.CaptionHeight + 20;
21 | //常用设置图片缩放模式:
22 | //1.AutoSize 控件大小等于图片大小
23 | //2.Zoom 控件大小不变,图片按比例缩放后展示
24 | picture_paste.SizeMode = PictureBoxSizeMode.Zoom;
25 | FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
26 | picture_paste.Image = Image.FromStream(fileStream);
27 | fileStream.Close();
28 | //或者直接写
29 | //picture_paste.Image = Image.FromFile(path);
30 |
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_paste.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MyScreenTools/UI/Form_shortcut.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace 屏幕工具
12 | {
13 | public partial class Form_shortcut : Form
14 | {
15 | int mCatchHotKey = 0;
16 | int mPasteHotKey = 0;
17 | int mOcrBasicHotKey = 0;
18 | int mOcrExcelHotKey = 0;
19 | bool mIsSetSuccess = false;
20 | public Form_shortcut()
21 | {
22 | InitializeComponent();
23 | }
24 |
25 | private void Form_shortcut_Load(object sender, EventArgs e)
26 | {
27 | mCatchHotKey = Properties.Settings.Default.CatchHotKey;
28 | if (mCatchHotKey != 0)
29 | {
30 | tb_catch_key.Text = Char.ConvertFromUtf32(mCatchHotKey);
31 | }
32 | mPasteHotKey = Properties.Settings.Default.PasteHotKey;
33 | if (mPasteHotKey != 0)
34 | {
35 | tb_paste_key.Text = Char.ConvertFromUtf32(mPasteHotKey);
36 | }
37 | mOcrBasicHotKey = Properties.Settings.Default.OcrBasicHotKey;
38 | if (mOcrBasicHotKey != 0)
39 | {
40 | tb_ocr_basic_key.Text = Char.ConvertFromUtf32(mOcrBasicHotKey);
41 | }
42 | mOcrExcelHotKey = Properties.Settings.Default.OcrExcelHotKey;
43 | if (mOcrExcelHotKey != 0)
44 | {
45 | tb_ocr_excel_key.Text = Char.ConvertFromUtf32(mOcrExcelHotKey);
46 | }
47 | }
48 |
49 | private void Form_shortcut_FormClosing(object sender, FormClosingEventArgs e)
50 | {
51 | if (mIsSetSuccess)
52 | {
53 | this.DialogResult = DialogResult.OK;
54 | }
55 | }
56 |
57 | private void tb_catch_key_KeyUp(object sender, KeyEventArgs e)
58 | {
59 | // 目前仅支持Alt+单个字母的组合键
60 | if (e.KeyValue >= 0x41 && e.KeyValue <= 0x5A)
61 | {
62 | tb_catch_key.Text = e.KeyCode.ToString();
63 | mCatchHotKey = e.KeyValue;
64 | }
65 | }
66 |
67 | private void btn_catch_set_Click(object sender, EventArgs e)
68 | {
69 | if (mCatchHotKey != 0)
70 | {
71 | Properties.Settings.Default.CatchHotKey = mCatchHotKey;
72 | Properties.Settings.Default.Save();
73 | mIsSetSuccess = true;
74 | MessageBox.Show("设置成功");
75 | }
76 | else
77 | {
78 | MessageBox.Show("设置失败");
79 | }
80 | }
81 |
82 | private void tb_paste_key_KeyUp(object sender, KeyEventArgs e)
83 | {
84 | // 目前仅支持Alt+单个字母的组合键
85 | if (e.KeyValue >= 0x41 && e.KeyValue <= 0x5A)
86 | {
87 | tb_paste_key.Text = e.KeyCode.ToString();
88 | mPasteHotKey = e.KeyValue;
89 | }
90 | }
91 |
92 | private void btn_paste_set_Click(object sender, EventArgs e)
93 | {
94 | if (mPasteHotKey != 0)
95 | {
96 | Properties.Settings.Default.PasteHotKey = mPasteHotKey;
97 | Properties.Settings.Default.Save();
98 | mIsSetSuccess = true;
99 | MessageBox.Show("设置成功");
100 | }
101 | else
102 | {
103 | MessageBox.Show("设置失败");
104 | }
105 | }
106 |
107 | private void tb_ocr_basic_key_KeyUp(object sender, KeyEventArgs e)
108 | {
109 | // 目前仅支持Alt+单个字母的组合键
110 | if (e.KeyValue >= 0x41 && e.KeyValue <= 0x5A)
111 | {
112 | tb_ocr_basic_key.Text = e.KeyCode.ToString();
113 | mOcrBasicHotKey = e.KeyValue;
114 | }
115 | }
116 |
117 | private void btn_ocr_basic_set_Click(object sender, EventArgs e)
118 | {
119 | if (mOcrBasicHotKey != 0)
120 | {
121 | Properties.Settings.Default.OcrBasicHotKey = mOcrBasicHotKey;
122 | Properties.Settings.Default.Save();
123 | mIsSetSuccess = true;
124 | MessageBox.Show("设置成功");
125 | }
126 | else
127 | {
128 | MessageBox.Show("设置失败");
129 | }
130 | }
131 |
132 | private void tb_ocr_excel_key_KeyUp(object sender, KeyEventArgs e)
133 | {
134 | // 目前仅支持Alt+单个字母的组合键
135 | if (e.KeyValue >= 0x41 && e.KeyValue <= 0x5A)
136 | {
137 | tb_ocr_excel_key.Text = e.KeyCode.ToString();
138 | mOcrExcelHotKey = e.KeyValue;
139 | }
140 | }
141 |
142 | private void btn_ocr_excel_set_Click(object sender, EventArgs e)
143 | {
144 | if (mOcrExcelHotKey != 0)
145 | {
146 | Properties.Settings.Default.OcrExcelHotKey = mOcrExcelHotKey;
147 | Properties.Settings.Default.Save();
148 | mIsSetSuccess = true;
149 | MessageBox.Show("设置成功");
150 | }
151 | else
152 | {
153 | MessageBox.Show("设置失败");
154 | }
155 | }
156 |
157 | #region 这里代码是监听按键事件,实现组合键识别
158 | List catchKeyList = new List();
159 | bool isCatchKeyStart = false;
160 | private void tb_KeyDown(object sender, KeyEventArgs e)
161 | {
162 | Console.WriteLine("KeyDown: KeyCode = " + e.KeyCode + " KeyData = " + e.KeyData + " KeyValue = " + e.KeyValue);
163 | if (!isCatchKeyStart)
164 | {
165 | tb_catch_key.Text = "";
166 | isCatchKeyStart = true;
167 | catchKeyList.Clear();
168 | }
169 | if (!ContainsKey(catchKeyList, e) && e.KeyValue != 229)
170 | {
171 | catchKeyList.Add(e);
172 | }
173 | }
174 |
175 | private bool ContainsKey(List keyList, KeyEventArgs e)
176 | {
177 | if (keyList == null || e == null)
178 | {
179 | return false;
180 | }
181 | foreach (var item in keyList)
182 | {
183 | if (item.KeyValue == e.KeyValue)
184 | {
185 | return true;
186 | }
187 | }
188 | return false;
189 | }
190 |
191 | private void tb_KeyUp(object sender, KeyEventArgs e)
192 | {
193 | Console.WriteLine("KeyUp: KeyCode = " + e.KeyCode + " KeyData = " + e.KeyData + " KeyValue = " + e.KeyValue);
194 | if (isCatchKeyStart)
195 | {
196 | StringBuilder sb = new StringBuilder();
197 | for (int i = 0; i < catchKeyList.Count; i++)
198 | {
199 | sb.Append(catchKeyList[i].KeyCode.ToString().Replace("Key", ""));
200 | if (i != catchKeyList.Count - 1)
201 | {
202 | sb.Append( " + ");
203 | }
204 | }
205 | tb_catch_key.Text = "";
206 | tb_catch_key.Text = sb.ToString();
207 | isCatchKeyStart = false;
208 | }
209 | }
210 | #endregion
211 |
212 | }
213 | }
214 |
--------------------------------------------------------------------------------
/MyScreenTools/Utils/BaiduTranslateUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Net.Http;
7 | using Newtonsoft.Json;
8 | using Newtonsoft.Json.Linq;
9 | using System.Net.Http.Headers;
10 |
11 | namespace 屏幕工具
12 | {
13 | class BaiduTranslateUtils
14 | {
15 | // 调用getAccessToken()获取的 access_token建议根据expires_in 时间 设置缓存
16 | // 返回token示例
17 | public static String TOKEN = "24.adda70c11b9786206253ddb70affdc46.2592000.1493524354.282335-1234567";
18 |
19 | // 百度云中开通对应服务应用的 API Key 建议开通应用的时候多选服务
20 | public static String clientId = Properties.Settings.Default.TranslateApiKey;
21 | // 百度云中开通对应服务应用的 Secret Key
22 | public static String clientSecret = Properties.Settings.Default.TranslateSecretKey;
23 |
24 | public static string GetAccessToken()
25 | {
26 | if (clientId == null || clientSecret == null)
27 | {
28 | return null;
29 | }
30 | try
31 | {
32 | String authHost = "https://aip.baidubce.com/oauth/2.0/token";
33 | HttpClient client = new HttpClient();
34 | List> paraList = new List>();
35 | paraList.Add(new KeyValuePair("grant_type", "client_credentials"));
36 | paraList.Add(new KeyValuePair("client_id", clientId));
37 | paraList.Add(new KeyValuePair("client_secret", clientSecret));
38 |
39 | HttpResponseMessage response = client.PostAsync(authHost, new FormUrlEncodedContent(paraList)).Result;
40 | String result = response.Content.ReadAsStringAsync().Result;
41 | Console.WriteLine(result);
42 | return result;
43 | }
44 | catch (Exception)
45 | {
46 | return null;
47 | }
48 | }
49 |
50 | ///
51 | /// 百度云文本翻译通用版
52 | ///
53 | ///
54 | ///
55 | ///
56 | ///
57 | ///
58 | ///
59 | public static string TextTranslateBasic(string token, string text, string from, string to, string termIds)
60 | {
61 | if (token == null || text == null || from == null || to == null)
62 | {
63 | return null;
64 | }
65 | try
66 | {
67 | String authHost = "https://aip.baidubce.com/rpc/2.0/mt/texttrans/v1?access_token=" + token;
68 |
69 | JObject obj = new JObject();
70 | obj.Add("q", text);
71 | obj.Add("from", from);
72 | obj.Add("to", to);
73 | obj.Add("termIds", termIds == null ? "" : termIds);
74 |
75 | HttpClient client = new HttpClient();
76 | client.BaseAddress = new Uri(authHost);
77 | client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));//ACCEPT header
78 | HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, authHost);
79 | request.Content = new StringContent(obj.ToString(),
80 | Encoding.UTF8,
81 | "application/json");//CONTENT-TYPE header
82 |
83 | HttpResponseMessage response = client.SendAsync(request).Result;
84 | String result = response.Content.ReadAsStringAsync().Result;
85 | Console.WriteLine(result);
86 | return result;
87 | }
88 | catch (Exception)
89 | {
90 | return null;
91 | }
92 | }
93 |
94 | ///
95 | /// 百度云文本翻译词典版
96 | ///
97 | ///
98 | ///
99 | ///
100 | ///
101 | ///
102 | ///
103 | public static string TextTranslateDictionary(string token, string text, string from, string to, string termIds)
104 | {
105 | if (token == null || text == null || from == null || to == null)
106 | {
107 | return null;
108 | }
109 | try
110 | {
111 | String authHost = "https://aip.baidubce.com/rpc/2.0/mt/texttrans-with-dict/v1?access_token=" + token;
112 |
113 | JObject obj = new JObject();
114 | obj.Add("q", text);
115 | obj.Add("from", from);
116 | obj.Add("to", to);
117 | obj.Add("termIds", termIds == null ? "" : termIds);
118 |
119 | HttpClient client = new HttpClient();
120 | client.BaseAddress = new Uri(authHost);
121 | client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));//ACCEPT header
122 | HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, authHost);
123 | request.Content = new StringContent(obj.ToString(),
124 | Encoding.UTF8,
125 | "application/json");//CONTENT-TYPE header
126 |
127 | HttpResponseMessage response = client.SendAsync(request).Result;
128 | String result = response.Content.ReadAsStringAsync().Result;
129 | Console.WriteLine(result);
130 | return result;
131 | }
132 | catch (Exception)
133 | {
134 | return null;
135 | }
136 | }
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/MyScreenTools/bin/Debug/AipSdk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/bin/Debug/AipSdk.dll
--------------------------------------------------------------------------------
/MyScreenTools/bin/Debug/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/bin/Debug/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/MyScreenTools/bin/Debug/PrScrn.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/bin/Debug/PrScrn.dll
--------------------------------------------------------------------------------
/MyScreenTools/bin/Debug/Readme.txt:
--------------------------------------------------------------------------------
1 | ********************************************************************************
2 | * 屏幕工具程序版本说明 *
3 | ********************************************************************************
4 |
5 | /******************************************************************************/
6 | 版本号:2.2.1.0
7 | 升级人员:Lois
8 | 修改日期:2022-12-26
9 | 功能:
10 | 1、修改贴图窗口置顶;
11 | 2、增加百度云设置自动加载配置文件功能;
12 | 3、增加截图复制图像内容或路径选项设置;
13 | 4、增加帖文字功能;
14 |
15 | /******************************************************************************/
16 | 版本号:2.2.0.0
17 | 升级人员:Lois
18 | 修改日期:2022-10-27
19 | 功能:
20 | 1、增加GIF压缩功能;
21 | 2、修复界面最小化不能显示问题;
22 | 3、修复GIF录制在放大屏幕上鼠标位置不准问题;
23 |
24 | /******************************************************************************/
25 | 版本号:2.1.0.0
26 | 升级人员:Lois
27 | 修改日期:2022-10-16
28 | 功能:
29 | 1、将屏幕取色功能独立成单独模块;
30 | 2、新增GIF截屏功能单独模块;
31 |
32 | /******************************************************************************/
33 | 版本号:2.0.1.1
34 | 升级人员:Lois
35 | 修改日期:2022-08-22
36 | 功能:
37 | 1、修复开机启动截图保存失败问题;
38 |
39 | /******************************************************************************/
40 | 版本号:2.0.1.0
41 | 升级人员:Lois
42 | 修改日期:2022-08-17
43 | 功能:
44 | 1、增加贴图功能;
45 | 2、增加表格识别功能;
46 | 3、增加开机启动设置功能;
47 |
48 | /******************************************************************************/
49 | 版本号:2.0.0.1
50 | 升级人员:Lois
51 | 修改日期:2022-04-24
52 | 功能:
53 | 1、修复自动识别中英文和截图本程序窗口不隐藏问题;
54 |
55 | /******************************************************************************/
56 | 版本号:2.0.0.0
57 | 升级人员:Lois
58 | 修改日期:2022-04-23
59 | 功能:
60 | 1、增加句子翻译和词典翻译功能;
61 |
62 | /******************************************************************************/
63 | 版本号:1.0.0.0
64 | 升级人员:Lois
65 | 修改日期:2022-04-19
66 | 功能:
67 | 1、截图+快捷键截图;
68 | 2、文字识别+快捷键文字识别;
69 | 3、屏幕颜色提取+快捷键屏幕颜色提取;
70 | 4、翻译+划词翻译;
71 |
72 |
--------------------------------------------------------------------------------
/MyScreenTools/bin/Debug/屏幕工具.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/MyScreenTools/bin/Debug/屏幕工具.exe
--------------------------------------------------------------------------------
/ScreenColorPicker/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ScreenColorPicker/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 | using ScreenColorPicker.UI;
7 |
8 | namespace ScreenColorPicker
9 | {
10 | static class Program
11 | {
12 | ///
13 | /// 应用程序的主入口点。
14 | ///
15 | [STAThread]
16 | static void Main()
17 | {
18 | Application.EnableVisualStyles();
19 | Application.SetCompatibleTextRenderingDefault(false);
20 | Application.Run(new Form_color());
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ScreenColorPicker/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ScreenColorPicker")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ScreenColorPicker")]
13 | [assembly: AssemblyCopyright("Copyright © 2022")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("14ce1a3d-b7ae-4330-88bf-46feba9494b2")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/ScreenColorPicker/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScreenColorPicker.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的、缓存的 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScreenColorPicker.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
56 | /// 方法是使用此强类型资源类。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/ScreenColorPicker/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/ScreenColorPicker/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScreenColorPicker.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ScreenColorPicker/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ScreenColorPicker/Resources/color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/ScreenColorPicker/Resources/color.png
--------------------------------------------------------------------------------
/ScreenColorPicker/ScreenColorPicker.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {272D703B-B7A7-4993-8690-23390223D736}
8 | WinExe
9 | Properties
10 | ScreenColorPicker
11 | ScreenColorPicker
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 | color.ico
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | Form
55 |
56 |
57 | Form_color.cs
58 |
59 |
60 |
61 | ResXFileCodeGenerator
62 | Resources.Designer.cs
63 | Designer
64 |
65 |
66 | True
67 | Resources.resx
68 |
69 |
70 | Form_color.cs
71 |
72 |
73 | SettingsSingleFileGenerator
74 | Settings.Designer.cs
75 |
76 |
77 | True
78 | Settings.settings
79 | True
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
99 |
--------------------------------------------------------------------------------
/ScreenColorPicker/UI/Form_color.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Runtime.InteropServices;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 | using ScreenColorPicker.Utils;
12 | using ScreenColorPicker.LibHelper;
13 |
14 | namespace ScreenColorPicker.UI
15 | {
16 | public struct POINTAPI
17 | {
18 | public uint x;
19 | public uint y;
20 | }
21 |
22 | public partial class Form_color : Form
23 | {
24 | private bool stop = false;
25 | // 放大图
26 | private Bitmap zoomInBitmap;
27 | public Form_color()
28 | {
29 | InitializeComponent();
30 | zoomInBitmap = new Bitmap(this.pb_picture.Width / 2, this.pb_picture.Height / 2);
31 | btn_lock.Visible = false;
32 | }
33 |
34 | private void Form_color_Load(object sender, EventArgs e)
35 | {
36 | StartMouseHook();
37 | }
38 |
39 | private void Form_color_FormClosing(object sender, FormClosingEventArgs e)
40 | {
41 | StopMouseHook();
42 | }
43 |
44 | private void StartMouseHook()
45 | {
46 | MouseHook mouseHook = new MouseHook();
47 | mouseHook.MouseMove += new MouseEventHandler(mouseHook_MouseMove2);
48 | mouseHook.MouseDown += new MouseEventHandler(mouseHook_MouseDown2);
49 | mouseHook.Start();
50 | }
51 |
52 | private void StopMouseHook()
53 | {
54 | MouseHook mouseHook = new MouseHook();
55 | mouseHook.MouseMove -= new MouseEventHandler(mouseHook_MouseMove2);
56 | mouseHook.MouseDown -= new MouseEventHandler(mouseHook_MouseDown2);
57 | mouseHook.Stop();
58 | }
59 |
60 | void mouseHook_MouseDown2(object sender, MouseEventArgs e)
61 | {
62 | if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
63 | {
64 | //鼠标左键或右键点下 则停止取色
65 | if (!stop)
66 | {
67 | stop = true;
68 | btn_lock.Visible = true;
69 | }
70 | }
71 | }
72 |
73 | void mouseHook_MouseMove2(object sender, MouseEventArgs e)
74 | {
75 |
76 | ShowColorInfo(e.Location.X, e.Location.Y);
77 | }
78 |
79 | private void timer_Tick(object sender, EventArgs e)
80 | {
81 | //ShowColorInfo(0, 0);
82 | }
83 |
84 | private void ShowColorInfo(int X, int Y)
85 | {
86 | if (stop)
87 | {
88 | return;
89 | }
90 | POINTAPI Papi = new POINTAPI();
91 | //Papi.x = (uint)X;
92 | //Papi.y = (uint)Y;
93 | WinInfo.GetCursorPos(ref Papi);
94 |
95 | Color color;
96 | this.tb_pixel.Text = Papi.x + "," + Papi.y;
97 | using (Graphics gs = Graphics.FromImage(zoomInBitmap))
98 | {
99 | //复制当前屏幕到画板上
100 | gs.CopyFromScreen((int)Papi.x - zoomInBitmap.Width / 2, (int)Papi.y - zoomInBitmap.Height / 2, 0, 0, new System.Drawing.Size(zoomInBitmap.Width, zoomInBitmap.Height));
101 |
102 | color = zoomInBitmap.GetPixel(zoomInBitmap.Width / 2, zoomInBitmap.Height / 2);
103 | Pen pen = new Pen(Color.Red);
104 | gs.DrawLine(pen, new Point(zoomInBitmap.Width / 2, 0), new Point(zoomInBitmap.Width / 2, zoomInBitmap.Height));
105 | gs.DrawLine(pen, new Point(0, zoomInBitmap.Height / 2), new Point(zoomInBitmap.Width, zoomInBitmap.Height / 2));
106 | }
107 | this.pb_picture.BackgroundImage = new Bitmap(this.zoomInBitmap);
108 |
109 |
110 |
111 | //uint v_hwnd = WinInfo.WindowFromPoint(Papi.x, Papi.y);
112 | //uint v_DC = WinInfo.GetDC(v_hwnd);
113 | //WinInfo.ScreenToClient(v_hwnd, ref Papi);
114 | //uint v_Color = WinInfo.GetPixel(v_DC, Papi.x, Papi.y);
115 |
116 | uint v_Red, v_Green, v_Blue;
117 | v_Red = (uint)(color.R & 0xff);
118 | v_Green = (uint)(color.G & 0xff);
119 | v_Blue = (uint)(color.B & 0xff);
120 |
121 | this.tb_rgb.Text = v_Red.ToString("d") + "," + v_Green.ToString("d") + "," + v_Blue.ToString("d");
122 | this.tb_hex.Text = String.Format("{0:X2}{1:X2}{2:X2}", v_Red, v_Green, v_Blue);
123 | this.pb_color.BackColor = Color.FromArgb((int)v_Red, (int)v_Green, (int)v_Blue);
124 | double hue, sat, bri;
125 | ColorConversionUtils.RGB2HSB((int)v_Red, (int)v_Green, (int)v_Blue, out hue, out sat, out bri);
126 | this.tb_hsb.Text = ((int)hue).ToString("d") + "," + ((int)(sat * 255)).ToString("d") + "," + ((int)(bri * 255)).ToString("d");
127 | double h1, s1, l1;
128 | ColorConversionUtils.RGB2HSL((int)v_Red, (int)v_Green, (int)v_Blue, out h1, out s1, out l1);
129 | this.tb_hsl.Text = ((int)h1).ToString("d") + "," + ((int)(s1 * 255)).ToString("d") + "," + ((int)(l1 * 255)).ToString("d");
130 | double h2, s2, v2;
131 | ColorConversionUtils.RGB2HSV((int)v_Red, (int)v_Green, (int)v_Blue, out h2, out s2, out v2);
132 | this.tb_hsv.Text = ((int)h2).ToString("d") + "," + ((int)(s2 * 255)).ToString("d") + "," + ((int)(v2 * 255)).ToString("d");
133 | double c, m, y, k;
134 | ColorConversionUtils.RGB2CMYK((int)v_Red, (int)v_Green, (int)v_Blue, out c, out m, out y, out k);
135 | this.tb_cmyk.Text = ((int)(c * 100)).ToString("d") + "," + ((int)(m * 100)).ToString("d") + "," + ((int)(y * 100)).ToString("d") + "," + ((int)(k * 100)).ToString("d");
136 | //WinInfo.ReleaseDC(v_hwnd, v_DC);
137 | }
138 |
139 | private void btn_lock_Click(object sender, EventArgs e)
140 | {
141 | if (stop)
142 | {
143 | // 恢复取色
144 | stop = false;
145 | btn_lock.Visible = false;
146 | }
147 | }
148 |
149 | }
150 |
151 | public class WinInfo
152 | {
153 | [DllImport("user32.dll")]
154 | public static extern uint WindowFromPoint
155 | (
156 | uint x_point,
157 | uint y_point
158 | );
159 |
160 | [DllImport("user32.dll")]
161 | public static extern bool GetCursorPos
162 | (
163 | ref POINTAPI p
164 | );
165 |
166 | [DllImport("user32.dll")]
167 | public static extern uint ScreenToClient
168 | (
169 | uint hwnd,
170 | ref POINTAPI p
171 | );
172 |
173 | [DllImport("user32.dll")]
174 | public static extern uint GetDC
175 | (
176 | uint hwnd
177 | );
178 |
179 | [DllImport("gdi32.dll")]
180 | public static extern uint GetPixel
181 | (
182 | uint hDC,
183 | uint x,
184 | uint y
185 | );
186 |
187 | [DllImport("user32.dll")]
188 | public static extern uint ReleaseDC
189 | (
190 | uint hwnd,
191 | uint hdc
192 | );
193 | }
194 | }
195 |
--------------------------------------------------------------------------------
/ScreenColorPicker/color.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/ScreenColorPicker/color.ico
--------------------------------------------------------------------------------
/ScreenTextPaster/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ScreenTextPaster/FormTextPaster.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ScreenTextPaster
2 | {
3 | partial class FormTextPaster
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.cb_bold = new System.Windows.Forms.CheckBox();
33 | this.cb_text_size = new System.Windows.Forms.ComboBox();
34 | this.tb_paster = new System.Windows.Forms.TextBox();
35 | this.SuspendLayout();
36 | //
37 | // label1
38 | //
39 | this.label1.AutoSize = true;
40 | this.label1.Location = new System.Drawing.Point(84, 7);
41 | this.label1.Name = "label1";
42 | this.label1.Size = new System.Drawing.Size(65, 12);
43 | this.label1.TabIndex = 0;
44 | this.label1.Text = "字体大小:";
45 | //
46 | // cb_bold
47 | //
48 | this.cb_bold.AutoSize = true;
49 | this.cb_bold.Location = new System.Drawing.Point(12, 6);
50 | this.cb_bold.Name = "cb_bold";
51 | this.cb_bold.Size = new System.Drawing.Size(48, 16);
52 | this.cb_bold.TabIndex = 1;
53 | this.cb_bold.Text = "粗体";
54 | this.cb_bold.UseVisualStyleBackColor = true;
55 | this.cb_bold.CheckedChanged += new System.EventHandler(this.cb_bold_CheckedChanged);
56 | //
57 | // cb_text_size
58 | //
59 | this.cb_text_size.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
60 | this.cb_text_size.FormattingEnabled = true;
61 | this.cb_text_size.Items.AddRange(new object[] {
62 | "5",
63 | "5.5",
64 | "6.5",
65 | "7.5",
66 | "9",
67 | "10.5",
68 | "12",
69 | "14",
70 | "15",
71 | "16",
72 | "18",
73 | "20",
74 | "22",
75 | "24",
76 | "26",
77 | "28",
78 | "36",
79 | "42",
80 | "48",
81 | "72"});
82 | this.cb_text_size.Location = new System.Drawing.Point(147, 3);
83 | this.cb_text_size.Name = "cb_text_size";
84 | this.cb_text_size.Size = new System.Drawing.Size(121, 20);
85 | this.cb_text_size.TabIndex = 2;
86 | this.cb_text_size.SelectedIndexChanged += new System.EventHandler(this.cb_text_size_SelectedIndexChanged);
87 | //
88 | // tb_paster
89 | //
90 | this.tb_paster.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
91 | | System.Windows.Forms.AnchorStyles.Left)
92 | | System.Windows.Forms.AnchorStyles.Right)));
93 | this.tb_paster.Location = new System.Drawing.Point(0, 28);
94 | this.tb_paster.Multiline = true;
95 | this.tb_paster.Name = "tb_paster";
96 | this.tb_paster.Size = new System.Drawing.Size(601, 117);
97 | this.tb_paster.TabIndex = 3;
98 | //
99 | // FormTextPaster
100 | //
101 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
102 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
103 | this.ClientSize = new System.Drawing.Size(602, 146);
104 | this.Controls.Add(this.tb_paster);
105 | this.Controls.Add(this.cb_text_size);
106 | this.Controls.Add(this.cb_bold);
107 | this.Controls.Add(this.label1);
108 | this.MinimumSize = new System.Drawing.Size(350, 140);
109 | this.Name = "FormTextPaster";
110 | this.ShowIcon = false;
111 | this.Text = "帖文字";
112 | this.TopMost = true;
113 | this.Load += new System.EventHandler(this.FormTextPaster_Load);
114 | this.ResumeLayout(false);
115 | this.PerformLayout();
116 |
117 | }
118 |
119 | #endregion
120 |
121 | private System.Windows.Forms.Label label1;
122 | private System.Windows.Forms.CheckBox cb_bold;
123 | private System.Windows.Forms.ComboBox cb_text_size;
124 | private System.Windows.Forms.TextBox tb_paster;
125 | }
126 | }
127 |
128 |
--------------------------------------------------------------------------------
/ScreenTextPaster/FormTextPaster.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace ScreenTextPaster
12 | {
13 | public partial class FormTextPaster : Form
14 | {
15 | public FormTextPaster()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void FormTextPaster_Load(object sender, EventArgs e)
21 | {
22 | cb_text_size.SelectedIndex = 7;
23 | setTextBoxFont();
24 | }
25 |
26 | private void cb_text_size_SelectedIndexChanged(object sender, EventArgs e)
27 | {
28 | setTextBoxFont();
29 | }
30 |
31 | private void cb_bold_CheckedChanged(object sender, EventArgs e)
32 | {
33 | setTextBoxFont();
34 | }
35 |
36 | private void setTextBoxFont()
37 | {
38 | if (cb_bold.Checked)
39 | {
40 | tb_paster.Font = new Font(tb_paster.Font.FontFamily, float.Parse(cb_text_size.Text), tb_paster.Font.Style | FontStyle.Bold);
41 | }
42 | else
43 | {
44 | tb_paster.Font = new Font(tb_paster.Font.FontFamily, float.Parse(cb_text_size.Text), tb_paster.Font.Style ^ FontStyle.Bold);
45 | }
46 | //tb_paster.Font = new Font(tb_paster.Font.FontFamily, float.Parse(cb_text_size.Text), tb_paster.Font.Style);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/ScreenTextPaster/FormTextPaster.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/ScreenTextPaster/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace ScreenTextPaster
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new FormTextPaster());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ScreenTextPaster/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ScreenTextPaster")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ScreenTextPaster")]
13 | [assembly: AssemblyCopyright("Copyright © 2022")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("73a2466d-130f-4f31-9f63-5eff3a06dcda")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/ScreenTextPaster/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScreenTextPaster.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的、缓存的 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScreenTextPaster.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
56 | /// 方法是使用此强类型资源类。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/ScreenTextPaster/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/ScreenTextPaster/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScreenTextPaster.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ScreenTextPaster/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ScreenTextPaster/ScreenTextPaster.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {DC7A057B-8C57-45C8-B3E6-9F1BBF061BCC}
8 | WinExe
9 | Properties
10 | ScreenTextPaster
11 | ScreenTextPaster
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | FormTextPaster.cs
52 |
53 |
54 |
55 |
56 | FormTextPaster.cs
57 |
58 |
59 | ResXFileCodeGenerator
60 | Resources.Designer.cs
61 | Designer
62 |
63 |
64 | True
65 | Resources.resx
66 |
67 |
68 | SettingsSingleFileGenerator
69 | Settings.Designer.cs
70 |
71 |
72 | True
73 | Settings.settings
74 | True
75 |
76 |
77 |
78 |
79 |
80 |
81 |
88 |
--------------------------------------------------------------------------------
/ScreenToGif/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 500, 400
15 |
16 |
17 | 500, 400
18 |
19 |
20 | 2
21 |
22 |
23 | False
24 |
25 |
26 | False
27 |
28 |
29 | 600, 500
30 |
31 |
32 | 500, 400
33 |
34 |
35 | 0
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/ScreenToGif/Encoding/FrameInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 |
3 | namespace ScreenToGif.Encoding
4 | {
5 | ///
6 | /// Frame info class.
7 | ///
8 | public class FrameInfo
9 | {
10 | #region Constructor
11 |
12 | ///
13 | /// Initialises a FrameInfo instance.
14 | ///
15 | /// The Bitmap.
16 | /// The TopLeft point.
17 | public FrameInfo(string bitmap, Point posUp)
18 | {
19 | Image = bitmap;
20 | PositionTopLeft = posUp;
21 | }
22 |
23 | #endregion
24 |
25 | #region Auto Properties
26 |
27 | ///
28 | /// The frame image full path.
29 | ///
30 | public string Image { get; set; }
31 |
32 | ///
33 | /// The frame position. Usually 0,0 except when "analyze unchanged pixels" is set to true.
34 | ///
35 | public Point PositionTopLeft { get; set; }
36 |
37 | ///
38 | /// The delay of the frame.
39 | ///
40 | public int Delay { get; set; }
41 |
42 | #endregion
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ScreenToGif/Encoding/PixelUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Drawing.Imaging;
5 | using System.Linq;
6 | using System.Runtime.InteropServices;
7 | using System.Text;
8 |
9 | namespace ScreenToGif.Encoding
10 | {
11 | ///
12 | /// Helper Class that gets and sets image pixels using Marshal calls.
13 | ///
14 | public class PixelUtil
15 | {
16 | readonly Bitmap _source = null;
17 | IntPtr _iptr = IntPtr.Zero;
18 | BitmapData _bitmapData = null;
19 |
20 | public byte[] Pixels { get; set; }
21 | public int Depth { get; private set; }
22 | public int Width { get; private set; }
23 | public int Height { get; private set; }
24 |
25 | ///
26 | /// Pixel marshalling class, use this to access pixels rapidly.
27 | ///
28 | /// The Bitmap to work with
29 | public PixelUtil(Bitmap source)
30 | {
31 | //this.source = new Bitmap(source); //Not working
32 | this._source = source;
33 | }
34 |
35 | ///
36 | /// Lock bitmap data
37 | ///
38 | public void LockBits()
39 | {
40 | try
41 | {
42 | // Get width and height of bitmap
43 | Width = _source.Width;
44 | Height = _source.Height;
45 |
46 | // Get total locked pixels count
47 | int pixelCount = Width * Height;
48 |
49 | // Create rectangle to lock
50 | var rect = new Rectangle(0, 0, Width, Height);
51 |
52 | // get source bitmap pixel format size
53 | Depth = Image.GetPixelFormatSize(_source.PixelFormat);
54 |
55 | // Check if bpp (Bits Per Pixel) is 8, 24, or 32
56 | if (Depth != 8 && Depth != 24 && Depth != 32)
57 | {
58 | throw new ArgumentException("Only 8, 24 and 32 bpp images are supported.");
59 | }
60 |
61 | // Lock bitmap and return bitmap data
62 | _bitmapData = _source.LockBits(rect, ImageLockMode.ReadWrite,
63 | _source.PixelFormat);
64 |
65 | // create byte array to copy pixel values
66 | int step = Depth / 8;
67 | Pixels = new byte[pixelCount * step];
68 | _iptr = _bitmapData.Scan0;
69 |
70 | // Copy data from pointer to array
71 | Marshal.Copy(_iptr, Pixels, 0, Pixels.Length);
72 | }
73 | catch (Exception e)
74 | {
75 | throw;
76 | }
77 | }
78 |
79 | ///
80 | /// Unlock bitmap data
81 | ///
82 | public void UnlockBits()
83 | {
84 | try
85 | {
86 | // Copy data from byte array to pointer
87 | Marshal.Copy(Pixels, 0, _iptr, Pixels.Length);
88 |
89 | // Unlock bitmap data
90 | _source.UnlockBits(_bitmapData);
91 | }
92 | catch (Exception ex)
93 | {
94 | throw;
95 | }
96 | }
97 |
98 | ///
99 | /// Get the color of the specified pixel
100 | ///
101 | ///
102 | ///
103 | ///
104 | public Color GetPixel(int x, int y)
105 | {
106 | Color clr = Color.Empty;
107 |
108 | // Get color components count
109 | int cCount = Depth / 8;
110 |
111 | // Get start index of the specified pixel
112 | int i = ((y * Width) + x) * cCount;
113 |
114 | if (i > Pixels.Length - cCount)
115 | throw new IndexOutOfRangeException();
116 |
117 | if (Depth == 32) //For 32 bpp get Red, Green, Blue and Alpha
118 | {
119 | byte b = Pixels[i];
120 | byte g = Pixels[i + 1];
121 | byte r = Pixels[i + 2];
122 | byte a = Pixels[i + 3]; // a
123 | clr = Color.FromArgb(a, r, g, b);
124 | }
125 | if (Depth == 24) //For 24 bpp get Red, Green and Blue
126 | {
127 | byte b = Pixels[i];
128 | byte g = Pixels[i + 1];
129 | byte r = Pixels[i + 2];
130 | clr = Color.FromArgb(r, g, b);
131 | }
132 | if (Depth == 8) //For 8 bpp get color value (Red, Green and Blue values are the same)
133 | {
134 | byte c = Pixels[i];
135 | clr = Color.FromArgb(c, c, c);
136 | }
137 | return clr;
138 | }
139 |
140 | ///
141 | /// Set the color of the specified pixel
142 | ///
143 | ///
144 | ///
145 | ///
146 | public void SetPixel(int x, int y, Color color)
147 | {
148 | //Get color components count
149 | int cCount = Depth / 8;
150 |
151 | //Get start index of the specified pixel
152 | int i = ((y * Width) + x) * cCount;
153 |
154 | if (Depth == 32) //For 32 bpp set Red, Green, Blue and Alpha
155 | {
156 | Pixels[i] = color.B;
157 | Pixels[i + 1] = color.G;
158 | Pixels[i + 2] = color.R;
159 | Pixels[i + 3] = color.A;
160 | }
161 | if (Depth == 24) //For 24 bpp set Red, Green and Blue
162 | {
163 | Pixels[i] = color.B;
164 | Pixels[i + 1] = color.G;
165 | Pixels[i + 2] = color.R;
166 | }
167 | if (Depth == 8) //For 8 bpp set color value (Red, Green and Blue values are the same)
168 | {
169 | Pixels[i] = color.B;
170 | }
171 | }
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/ScreenToGif/LibHelper/HotKeyDllHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Runtime.InteropServices;
7 |
8 | namespace ScreenToGif.LibHelper
9 | {
10 | public class HotKeyDllHelper
11 | {
12 | //加载dll,调用win32API。
13 | [DllImport("user32.dll", SetLastError = true)]
14 | //声明注册快捷键方法,方法实体dll中。参数为窗口句柄,快捷键自定义ID,Ctrl,Shift等功能键,其他按键。
15 | public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
16 | [DllImport("user32.dll", SetLastError = true)]
17 | //注销快捷键方法的声明。
18 | public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/ScreenToGif/LibHelper/System32DllHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Runtime.InteropServices;
7 | using System.Drawing;
8 |
9 | namespace ScreenToGif.LibHelper
10 | {
11 | [StructLayout(LayoutKind.Sequential)]
12 | public struct CursorInfo
13 | {
14 | public Int32 cbSize;
15 | public Int32 flags;
16 | public IntPtr hCursor;
17 | public Point ptScreenPos;
18 | }
19 |
20 | public enum DeviceCap
21 | {
22 | HORZRES = 8,
23 | VERTRES = 10,
24 | LOGPIXELSX = 88,
25 | LOGPIXELSY = 90,
26 | PHYSICALWIDTH = 110,
27 | SCALINGFACTORX = 114,
28 | DESKTOPVERTRES = 117,
29 | DESKTOPHORZRES = 118
30 | }
31 |
32 | public class System32DllHelper
33 | {
34 | [DllImport("gdi32.dll", EntryPoint = "GetDeviceCaps", SetLastError = true)]
35 | public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
36 |
37 | private const Int32 CURSOR_SHOWING = 0x00000001;
38 | [DllImport("user32.dll")]
39 | public static extern bool GetCursorInfo(out CursorInfo cursorInfo);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/ScreenToGif/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 | using ScreenToGif.UI;
7 |
8 | namespace ScreenToGif
9 | {
10 | static class Program
11 | {
12 | ///
13 | /// 应用程序的主入口点。
14 | ///
15 | [STAThread]
16 | static void Main()
17 | {
18 | Application.EnableVisualStyles();
19 | Application.SetCompatibleTextRenderingDefault(false);
20 | Application.Run(new Form_gif_main());
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ScreenToGif/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ScreenToGif")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ScreenToGif")]
13 | [assembly: AssemblyCopyright("Copyright © 2022")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("a50c8cf7-64ad-4f53-ad15-92df5e5dc63f")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.1.0.0")]
36 | [assembly: AssemblyFileVersion("1.1.0.0")]
37 |
--------------------------------------------------------------------------------
/ScreenToGif/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScreenToGif.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的、缓存的 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScreenToGif.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
56 | /// 方法是使用此强类型资源类。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/ScreenToGif/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/ScreenToGif/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScreenToGif.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("500, 400")]
29 | public global::System.Drawing.Size Setting_gif_area_size {
30 | get {
31 | return ((global::System.Drawing.Size)(this["Setting_gif_area_size"]));
32 | }
33 | set {
34 | this["Setting_gif_area_size"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("500, 400")]
41 | public global::System.Drawing.Point Setting_gif_area_location {
42 | get {
43 | return ((global::System.Drawing.Point)(this["Setting_gif_area_location"]));
44 | }
45 | set {
46 | this["Setting_gif_area_location"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("2")]
53 | public int Setting_gif_fps {
54 | get {
55 | return ((int)(this["Setting_gif_fps"]));
56 | }
57 | set {
58 | this["Setting_gif_fps"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
65 | public bool Setting_is_full_screen {
66 | get {
67 | return ((bool)(this["Setting_is_full_screen"]));
68 | }
69 | set {
70 | this["Setting_is_full_screen"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
77 | public bool Setting_is_catch_mouse {
78 | get {
79 | return ((bool)(this["Setting_is_catch_mouse"]));
80 | }
81 | set {
82 | this["Setting_is_catch_mouse"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("600, 500")]
89 | public global::System.Drawing.Size Setting_form_size {
90 | get {
91 | return ((global::System.Drawing.Size)(this["Setting_form_size"]));
92 | }
93 | set {
94 | this["Setting_form_size"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("500, 400")]
101 | public global::System.Drawing.Point Setting_form_location {
102 | get {
103 | return ((global::System.Drawing.Point)(this["Setting_form_location"]));
104 | }
105 | set {
106 | this["Setting_form_location"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
113 | public int Setting_form_encode_mode {
114 | get {
115 | return ((int)(this["Setting_form_encode_mode"]));
116 | }
117 | set {
118 | this["Setting_form_encode_mode"] = value;
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ScreenToGif/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 500, 400
7 |
8 |
9 | 500, 400
10 |
11 |
12 | 2
13 |
14 |
15 | False
16 |
17 |
18 | False
19 |
20 |
21 | 600, 500
22 |
23 |
24 | 500, 400
25 |
26 |
27 | 0
28 |
29 |
30 |
--------------------------------------------------------------------------------
/ScreenToGif/Resources/gif.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/ScreenToGif/Resources/gif.png
--------------------------------------------------------------------------------
/ScreenToGif/ScreenToGif.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {51F5B263-0DF8-46AE-B1BB-A4AF0B12F69F}
8 | WinExe
9 | Properties
10 | ScreenToGif
11 | ScreenToGif
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 | gif.ico
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | Form
62 |
63 |
64 | Form_gif_main.cs
65 |
66 |
67 |
68 |
69 | ResXFileCodeGenerator
70 | Resources.Designer.cs
71 | Designer
72 |
73 |
74 | True
75 | Resources.resx
76 |
77 |
78 | Form_gif_main.cs
79 |
80 |
81 | SettingsSingleFileGenerator
82 | Settings.Designer.cs
83 |
84 |
85 | True
86 | Settings.settings
87 | True
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
104 |
--------------------------------------------------------------------------------
/ScreenToGif/gif.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luotengyuan/MyScreenTools/8ea983027283a73b6851ac6afea5cc0bd70846bd/ScreenToGif/gif.ico
--------------------------------------------------------------------------------