在WinForm开发中,在处理大量数据时不免会有耗时较长的操作,如果将这些操作放在主线程里,软件界面会有较长时间的“无响应”,降低了用户体验,常用的解决方式是加上进度条。 实现思路 -------------------------------------------------------------------------------- 使用BackgroundWorker(已经封装好的线程工具)控件在后台线程执行费时的操作,在主线程中打开一个进度条窗体显示进度。 实现步骤 -------------------------------------------------------------------------------- 第0步:创建一个具有进度条的窗体,以显示进度 新建窗体ProcessForm,设置属性FormBorderStyle为None,添加一个ProcessBar控件,如下图所示: 进度条窗体 PrcessBar的Style属性设置为MarQuee。在ProcessForm添加如下公共属性: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 /// /// 设置提示信息 /// public string MessageInfo { set { this.labelInfor.Text = value; } } /// /// 设置进度条显示值 /// public int ProcessValue { set { this.progressBar1.Value = value; } } /// /// 设置进度条样式 /// public ProgressBarStyle ProcessStyle { set { this.progressBar1.Style = value; } } 第1步:创建进度条管理类ProcessOperator 在该类中添加如下字段: ? 1 2 private BackgroundWorker _backgroundWorker;//后台线程 private ProcessForm _processForm;//进度条窗体 添加如下公共属性、方法和事件: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #region 公共方法、属性、事件 /// /// 后台执行的操作 /// public Action BackgroundWork { get; set; } /// /// 设置进度条显示的提示信息 /// public string MessageInfo { set { _processForm.MessageInfo = value; } } /// /// 后台任务执行完毕后事件 /// public event EventHandler BackgroundWorkerCompleted; /// /// 开始执行 /// public void Start() { _backgroundWorker.RunWorkerAsync(); _processForm.ShowDialog(); } #endregion 其中,属性BackgroundWork可以指向一个无参数的方法,这里(客户端代码)用来指向要在
2021-02-26 08:57:04 34KB Winform 进度条 Background Worker
1
Combining background information and a top-down model for computing salient objects
2021-02-22 14:05:51 1.25MB 研究论文
1
Pedestrian detection is a fundamental problem in video surveillance. An overwhelming majority of existing detection methods are based on sliding windows with exhaustive multi-scale scanning over the whole frame images which can achieve good accuracy but suffer from expensive computational cost. To reduce the complexity significantly while keeping high accuracy, in this paper, we propose an effective and efficient pedestrian detection method based on sliding windows with well-designed multi-scale
2021-02-09 18:06:13 488KB Background subtraction; Computational costs;
1
通过该蛇皮项目的实战,了解HBase的应用场景和如何使用JAVA-API来完成对于增删改查数据的需求
2021-01-28 04:22:23 20KB HBase hadoop java
1
留个备份,有需要的拿去吧
2021-01-28 02:21:39 81KB chrome插件
1
这个插件包含了 main.js(popup页面使用的js) 跟 background.js(后台) 之前的通信 main.js(popup页面使用的js) 跟 content.js(注入到dom的js) 之前的通信 background.js 跟 cntent.js 之前的通信
2020-12-15 14:08:06 2.31MB Chrome插件
1
backgroundworker+process进度条完整解决方案,以测试通过
2020-01-03 11:36:02 41KB background
1
GMM算法经典论文,opencv中的GMM算法应该就是参考这边文章。自己做的中文翻译pdf也附在了里面
2019-12-21 20:14:58 1.02MB GMM
1
Improved adaptive Gausian mixture model for background subtraction,经典的GMM算法改进论文,opencv中的GMM改进算法有参考这篇文章,把自己的翻译也附在里面
2019-12-21 18:51:43 762KB GMM OpenCv
1