91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

文件導出時進度條顯示其導出的進度。利用委托和事件,使窗體避免造成假死狀態。是理解進度條比較好的案例

資源截圖

代碼片段和文件信息

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.Threading;

namespace?ProgressBarTest
{
????public?partial?class?Catch?:?Form
????{
????????public?Catch()
????????{
????????????InitializeComponent();
????????}

????????#region?用戶變量
????????Point?DownPoint?=?Point.Empty;?//記錄按下鼠標時的坐標
????????bool?CatchFinished?=?false;????//表示是否完成截圖
????????bool?CatchStart?=?false;???????//表示截圖開始
????????Bitmap?originBmp;??????????????//用來保存原始的圖像
????????Rectangle?CatchRect;???????????//用來保存截圖的矩形
????????#endregion

????????private?void?Catch_Load(object?sender?EventArgs?e)
????????{
????????????this.Setstyle(Controlstyles.OptimizedDoubleBuffer?|?Controlstyles.AllPaintingInWmPaint?|?Controlstyles.UserPaint?true);
????????????this.Updatestyles();
????????????Bitmap?CatchBmp?=?new?Bitmap(Screen.AllScreens[0].Bounds.Width?Screen.AllScreens[0].Bounds.Height);//新建一個和屏幕大小相同的圖片
????????????this.BackgroundImage?=?CatchBmp;
????????????originBmp?=?new?Bitmap(this.BackgroundImage);
????????}

????????private?void?Catch_MouseClick(object?sender?MouseEventArgs?e)
????????{
????????????if?(e.Button?==?MouseButtons.Right)
????????????{
????????????????this.DialogResult?=?DialogResult.OK;
????????????????this.Close();
????????????}
????????}

????????private?void?Catch_MouseDown(object?sender?MouseEventArgs?e)
????????{
????????????if?(e.Button?==?MouseButtons.Left)
????????????{
????????????????if?(!CatchStart)
????????????????{
????????????????????CatchStart?=?true;
????????????????????DownPoint?=?new?Point(e.X?e.Y);
????????????????}
????????????}
????????}

????????private?void?Catch_MouseMove(object?sender?MouseEventArgs?e)
????????{
????????????if?(CatchStart)
????????????{//如果捕捉開始
????????????????Bitmap?destBmp?=?(Bitmap)originBmp.Clone();//新建一個圖片對象,并讓它與原始圖片相同
????????????????Point?newPoint?=?new?Point(DownPoint.X?DownPoint.Y);//獲取鼠標的坐標
????????????????Graphics?g?=?Graphics.FromImage(destBmp);//在剛才新建的圖片上新建一個畫板
????????????????Pen?p?=?new?Pen(Color.Blue?1);
????????????????int?width?=?Math.Abs(e.X?-?DownPoint.X)?height?=?Math.Abs(e.Y?-?DownPoint.Y);//獲取矩形的長和寬
????????????????if?(e.X?????????????????{
????????????????????newPoint.X?=?e.X;
????????????????}
????????????????if?(e.Y?????????????????{
????????????????????newPoint.Y?=?e.Y;
????????????????}
????????????????CatchRect?=?new?Rectangle(newPoint?new?Size(width?height));//保存矩形
????????????????g.DrawRectangle(p?CatchRect);//將矩形畫在這個畫板上
????????????????g.Dispose();//釋放目前的這個畫板
????????????????p.Dispose();
????????????????Graphics?g1?=?this.CreateGraphics();//重新新建一個Graphics類
????????????????//如果之前那個畫板不釋放,而直接g=this.CreateGraphics()這樣的話無法釋放掉第一次創建的g因為只是把地址轉到新的g了.如同string一樣
????????????????g1?=?this.CreateGraphics();//在整個全屏窗體上新建畫板
????????????????g1.DrawImag

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???73761344??2012-05-28?21:00??Works\bin\Debug\FileTxt.txt

?????文件????????176??2012-03-03?16:53??Works\bin\Debug\MyFile.bin

?????文件??????14848??2012-07-24?14:43??Works\bin\Debug\ProgressBarTest.exe

?????文件??????26112??2012-07-24?14:43??Works\bin\Debug\ProgressBarTest.pdb

?????文件??????14328??2012-07-24?14:41??Works\bin\Debug\ProgressBarTest.vshost.exe

?????文件????????490??2007-07-21?02:33??Works\bin\Debug\ProgressBarTest.vshost.exe.manifest

?????文件??????18944??2012-03-12?16:02??Works\bin\Debug\進度條測試.exe

?????文件??????44544??2012-03-12?16:02??Works\bin\Debug\進度條測試.pdb

?????文件????????490??2007-07-21?02:33??Works\bin\Debug\進度條測試.vshost.exe.manifest

?????文件???????6689??2012-05-21?11:59??Works\Catch.cs

?????文件???????3328??2012-05-21?11:59??Works\Catch.Designer.cs

?????文件???????5814??2012-05-21?11:59??Works\Catch.resx

?????文件???????7230??2012-05-18?15:01??Works\ExcelReport.cs

?????文件???????9998??2012-05-18?15:01??Works\ExcelReport.Designer.cs

?????文件???????8020??2012-05-18?15:01??Works\ExcelReport.resx

?????文件???????2014??2012-05-22?18:08??Works\GDITest.cs

?????文件???????1583??2012-05-18?17:33??Works\GDITest.Designer.cs

?????文件???????5814??2012-05-18?17:33??Works\GDITest.resx

?????文件???????1354??2012-07-24?14:43??Works\obj\Debug\ProgressBarTest.csproj.FileListAbsolute.txt

?????文件????????853??2012-07-24?14:42??Works\obj\Debug\ProgressBarTest.csproj.GenerateResource.Cache

?????文件????????180??2012-07-24?14:42??Works\obj\Debug\ProgressBarTest.ExcelReport.resources

?????文件??????14848??2012-07-24?14:43??Works\obj\Debug\ProgressBarTest.exe

?????文件??????26112??2012-07-24?14:43??Works\obj\Debug\ProgressBarTest.pdb

?????文件????????180??2012-07-24?14:42??Works\obj\Debug\ProgressBarTest.Properties.Resources.resources

?????文件???????4608??2012-03-12?16:10??Works\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

?????文件????????757??2012-03-12?16:02??Works\obj\Debug\進度條測試.csproj.FileListAbsolute.txt

?????文件????????990??2012-03-12?15:30??Works\obj\Debug\進度條測試.csproj.GenerateResource.Cache

?????文件??????18944??2012-03-12?16:02??Works\obj\Debug\進度條測試.exe

?????文件??????44544??2012-03-12?16:02??Works\obj\Debug\進度條測試.pdb

?????文件????????180??2012-03-12?10:31??Works\obj\Debug\進度條測試.Properties.Resources.resources

............此處省略25個文件信息

評論

共有 條評論