資源簡介
C#定坐標快捷截圖工具及源代碼(可雙屏選擇),可根據文件名表自動順序命名圖片

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;
namespace?截圖工具
{
????public?partial?class?Form1?:?Form
????{
????????//[DllImport(“user32.dll“)]
????????//public?static?extern?bool?ReleaseCapture();
????????//[DllImport(“user32.dll“)]
????????//public?static?extern?IntPtr?SetCapture(IntPtr?h);
????????static?public?int?jietuw?=?0;
????????static?public?int?jietuh?=?0;
????????string[]?lines;
????????int?shubiao?=?0;
????????int?xyzclick?=?0;
????????static?public?int?check?=?0;
????????static?public?int?count?=?1;
????????static?public?int?topcut?=?0;
????????static?public?int?leftcut?=?0;
????????static?public?int?rightcut?=?0;
????????static?public?int?botcut?=?40;
????????string?wenjianjia?=?@“c:“;
????????string?tuming?=?“截圖“;
????????public?Form1()
????????{
????????????InitializeComponent();
????????????//try
????????????//{
????????????//????s?=?new?CopyScreen();
????????????//????s.GetScreenImage??=?new?CopyScreen.GetImage(s_GetScreenImage);
????????????//}
????????????//catch?(Exception?ex)?{?MessageBox.Show(ex.Message);?}
????????}
???????
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????if?(dataGridView1.Rows.Count?>?1?&&?checkBox1.Checked?==?true)
????????????{
????????????????dataGridView1.Rows[count?-?1].Cells[0].Selected?=?true;
????????????????this.dataGridView1.FirstDisplayedScrollingRowIndex?=?count?-?1;
????????????}
????????????if(checkBox1.Checked!=true)
????????????{
????????????if?(radioButton1.Checked?==?true)
????????????{
????????????????Bitmap?myImage?=?new?Bitmap(Screen.PrimaryScreen.Bounds.Width?-?leftcut?-?rightcut?Screen.PrimaryScreen.Bounds.Height?-?botcut?-?topcut);
????????????????Graphics?g?=?Graphics.FromImage(myImage);
????????????????g.CopyFromScreen(new?Point(0?+?leftcut?0?+?topcut)?new?Point(0?0)?new?Size(Screen.PrimaryScreen.Bounds.Width?-?leftcut?-?rightcut?Screen.PrimaryScreen.Bounds.Height?-?botcut?-?topcut));
????????????????IntPtr?dc1?=?g.GetHdc();
????????????????g.ReleaseHdc(dc1);
????????????????myImage.Save(wenjianjia?+?“\\“?+?tuming?+?Convert.ToString(count)?+?“.png“);
????????????????textBox6.Text?=?Convert.ToString(count);
????????????????count++;
??????????????
????????????}
????????????else?if?(radioButton2.Checked?==?true)
????????????{
????????????????Bitmap?myImage?=?new?Bitmap(Screen.AllScreens[0].Bounds.Width?-?leftcut?-?rightcut?Screen.AllScreens[0].Bounds.Height?-?botcut?-?topcut);
????????????????Graphics?g?=?Graphics.FromImage(myImage);
????????????????g.CopyFromScreen(new?Point(Screen.AllScreens[1].Bounds.Width?+?leftcut?+topcut)?new?Point(0?0)?new?Size(Screen.AllScreens[0].Bounds.Width?-?leftcut?-?rightcut?Screen.AllScreens[0].Bounds.Height?-?botcut?-?topcut));
????????????????IntPtr?dc1?=?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????232448??2018-01-05?13:29??截圖工具\截圖工具\bin\Debug\截圖工具.exe
?????文件??????50688??2018-01-05?13:29??截圖工具\截圖工具\bin\Debug\截圖工具.pdb
?????文件??????11608??2018-10-22?16:46??截圖工具\截圖工具\bin\Debug\截圖工具.vshost.exe
?????文件????????490??2016-03-09?13:48??截圖工具\截圖工具\bin\Debug\截圖工具.vshost.exe.manifest
?????文件??????20519??2018-01-05?13:29??截圖工具\截圖工具\Form1.cs
?????文件??????29147??2018-01-05?13:29??截圖工具\截圖工具\Form1.Designer.cs
?????文件?????107773??2018-01-05?13:29??截圖工具\截圖工具\Form1.resx
?????文件???????1582??2017-11-23?18:18??截圖工具\截圖工具\HotKey.cs
?????文件???????1229??2017-11-24?11:18??截圖工具\截圖工具\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6264??2018-01-05?13:29??截圖工具\截圖工具\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????2505??2018-10-22?16:46??截圖工具\截圖工具\obj\x86\Debug\截圖工具.csproj.FileListAbsolute.txt
?????文件???????1040??2018-01-05?13:29??截圖工具\截圖工具\obj\x86\Debug\截圖工具.csproj.GenerateResource.Cache
?????文件???????1757??2017-11-24?11:20??截圖工具\截圖工具\obj\x86\Debug\截圖工具.csprojResolveAssemblyReference.cache
?????文件?????232448??2018-01-05?13:29??截圖工具\截圖工具\obj\x86\Debug\截圖工具.exe
?????文件??????68212??2018-01-05?13:29??截圖工具\截圖工具\obj\x86\Debug\截圖工具.Form1.resources
?????文件??????50688??2018-01-05?13:29??截圖工具\截圖工具\obj\x86\Debug\截圖工具.pdb
?????文件????????180??2017-11-24?10:37??截圖工具\截圖工具\obj\x86\Debug\截圖工具.Properties.Resources.resources
?????文件??????68212??2017-11-24?10:37??截圖工具\截圖工具\obj\x86\Debug\截圖工具.截圖預覽.resources
?????文件????????493??2017-11-23?17:52??截圖工具\截圖工具\Program.cs
?????文件???????1374??2017-11-23?17:52??截圖工具\截圖工具\Properties\AssemblyInfo.cs
?????文件???????2876??2017-11-23?17:52??截圖工具\截圖工具\Properties\Resources.Designer.cs
?????文件???????5612??2017-11-23?17:52??截圖工具\截圖工具\Properties\Resources.resx
?????文件???????1099??2017-11-23?17:52??截圖工具\截圖工具\Properties\Settings.Designer.cs
?????文件????????249??2017-11-23?17:52??截圖工具\截圖工具\Properties\Settings.settings
?????文件??????67646??2017-11-24?10:37??截圖工具\截圖工具\settings_128px_1145019_easyicon.net.ico
?????文件???????4169??2017-11-24?10:37??截圖工具\截圖工具\截圖工具.csproj
?????文件???????2407??2017-11-24?15:20??截圖工具\截圖工具\截圖預覽.cs
?????文件???????2706??2017-11-24?10:37??截圖工具\截圖工具\截圖預覽.Designer.cs
?????文件?????107589??2017-11-24?10:37??截圖工具\截圖工具\截圖預覽.resx
?????文件????????878??2017-11-23?17:52??截圖工具\截圖工具.sln
............此處省略13個文件信息
評論
共有 條評論