返回首页

{S0}简介
你想添加一些视觉增强Windows窗体应用程序?你有时间太长的进程?这种控制是为你。
基本上,它是一个进度条,但它是圆形的。您可以完全自定义其外观。例如,你可以改变环的厚度,段数,环的颜色,进步的颜色,间隔等。
控制,可以添加到工具箱,它可以添加控件从工具箱拖动和下降。
这是一个开放源码(C#)项目和编译。NET Framework 2.0版。使用代码
这是很简单的使用控制。所有您需要做的的是设置控制的旋转属性为true,启动循环。

this.progressBar1.BackColor = System.Drawing.Color.Transparent;

this.progressBar1.ForeColor = System.Drawing.Color.Gold;

this.progressBar1.Interval = 100;

this.progressBar1.Location = new System.Drawing.Point(235, 90);

this.progressBar1.Name = "progressBar1";

this.progressBar1.RingColor = System.Drawing.Color.White;

this.progressBar1.RingThickness = 30;

this.progressBar1.Size = new System.Drawing.Size(80, 80);

this.progressBar1.Rotate = true;         
历史原来的文章发表在{A}

回答

评论会员:tim_mcgwyn 时间:2011/12/18
您好,

损坏的zip文件IST!请更新您的文件

Greez
TMG
评论会员:k777 时间:2011/12/18
这是一个几个月我一直在寻找,因为我喜欢的方式使用Nero Suite的圆形进度控制,即一个透明背景的圆形进度指示器
不幸的是,我C开发人员而不是C#。我会尝试将它移植到C,但由于我的知识有限,我怀疑我能做到这一点。 ,所以,如果你计划有将它移植到MFC,我将不胜感激。

感谢您的文章
评论会员:。Lion_King1109 时间:2011/12/18
感谢你!强大的控制你已经有了从我投5

不可能=我可能
评论会员:!Yuyama 时间:2011/12/18
。一旦显示,进度圈,内存消耗不断增加,直到应用程序终止我证实了WIN XP的任务管理器的麻烦。为什么呢?

Yuyama
评论会员:UmutTezduyar 时间:2011/12/18
您好Yuyama,

有斜面的内存泄漏,因为是由垃圾收集器管理内存。 Graphics对象可以使用大量的内存,但最终它应该清理的GC(垃圾回收)

感谢
评论会员:游客 时间:2011/12/18
。Izzet凯雷姆Kusmezer
其实内存泄漏是由您的代码
DrawFilledArc部分引起
替换部分,用下面的代码,不创建一个新的SolidBrush DrawFilledArc获取创建时间,解决了这个问题。此外,我处置GraphicsPath的区域对象。
在这样的内存使用情况保持不变。

 private System.Collections.Generic.Dictionary<Color, SolidBrush> _brushCache = 

            new System.Collections.Generic.Dictionary<Color,SolidBrush>();

 

		private void DrawFilledArc (Graphics grp, Color color, int startAngle)

		{

			grp.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

 

			Rectangle main = this.ClientRectangle;

			

			// If there is no region to be drawn, then this method terminates itself

			if (main.Width - (2*this._ringThickness) < 1 || main.Height -(2*this._ringThickness) <= 1)

				return;

 

			// Calculates the region that will be filled



            using (GraphicsPath outerPath = new GraphicsPath())

            {

                outerPath.AddPie(main, startAngle, this.PieAngle);

 

                Rectangle sub = new Rectangle(main.X + this._ringThickness, main.Y + this._ringThickness, main.Width - (2 * this._ringThickness), main.Height - (2 * this._ringThickness));

 

                using (GraphicsPath innerPath = new GraphicsPath())

                {

                    innerPath.AddPie(sub, startAngle - 1, this.PieAngle + 2);

 

                    using (System.Drawing.Region mainRegion = new Region(outerPath))

                    {

                        using (System.Drawing.Region subRegion = new Region(innerPath))

                        {

 

                            mainRegion.Exclude(subRegion);

                            

                            SolidBrush targetBrush;

                            

                            if (_brushCache.ContainsKey(color))

                            {

                                targetBrush = _brushCache[color];

                            }

                            else

                            {

                                targetBrush = new SolidBrush(color);

                                _brushCache.Add(color,targetBrush);

                            }

                            // Fill that region

                            grp.FillRegion(targetBrush, mainRegion);

                        }

                    }

                }

            }

		}	


评论会员:UmutTezduyar 时间:2011/12/18
喜凯雷姆,

感谢您的解释。当我最初开发这个窗口控制。NET框架2.0在市场上。
我仔细研究堆的使用情况,似乎有没有内存泄漏的控制。
如果你们认为有虽然,我希望你的解决方案修复它。

感谢
评论会员:rmcavalcante 时间:2011/12/18
感谢Izzet凯雷姆Kusmezer,
我确认在Windows 7中的内存泄漏问题。我曾尝试您的解决方案,它确实有效。
恭喜为你,为主动的创造者和贡献者
评论会员:。VCKicks 时间:2011/12/18
。相当令人印象深刻,会更好看反锯齿虽然

尽管如此,道具

访问的Visual C#踢更多的自由,资源和下载

评论会员:UmutTezduyar 时间:2011/12/18
您好,

反锯齿是什么意思?

感谢
评论会员:。VCKicks 时间:2011/12/18
Graphics对象的平滑模式"属性。尝试将其设置抗混叠

访问的Visual C#踢更多的自由,资源和下载

评论会员:MauroGv 时间:2011/12/18
喜Umut Tezduyar,
我发现你的文章有趣,因为我需要从不同的视觉进度条通常的MS ProgressBar的我下载您的解决方案。我的zip文件中提取和加载在Visual Studio。
我跑... ...
在指令初始化组件(代码的第一条指令)程序停止和错误说"无法加载文件或程序集"ProgressCircle,版本=....,公钥=....'.不可能,保证授权。"(异常HRESULT:0x80131417)

ProgressCircle项目有一个key.snk文件也许是受保护的项目。我不知道。在此先感谢,
莫罗
评论会员:UmutTezduyar 时间:2011/12/18
嗨,

我还提供了该项目的源代码。你应该能够从头开始编译。

感谢
评论会员:菲尔赫罗尔德 时间:2011/12/18
?任何机会,你可以把代码项目,而不是GPL开放许可下提供

感谢
评论会员:。UmutTezduyar 时间:2011/12/18
为什么你会希望有不同的许可菲尔
评论会员:菲尔赫罗尔德 时间:2011/12/18
我"可能"在商业应用程序中使用的衍生(我有一些想法,和。情侣在它的错误已经修复了),但不如果它的GPL - 我根本就买不起,暴露。的CPOL要少得多的限制。我不是一个专家对这个东西,但我的理解。我的印象是,在CodeProject上的代码大部分是CPOL,这是伟大的。感谢
评论会员:游客 时间:2011/12/18
。QasemHeyraniNobari

QHN_PROF@Yahoo.com
评论会员:UmutTezduyar 时间:2011/12/18
嘿Qasem,

谢谢。我很高兴你觉得它有用