如何绘制一个漂亮的循环等待/进度条? [英] How to draw a pretty circular wait/progress bar?

查看:78
本文介绍了如何绘制一个漂亮的循环等待/进度条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF应用程序,我想在其中添加一个循环等待指示器,其中有一个图像作为其基础,然后覆盖一个3D彩色弧,其端点以不同的速率移动(如标准中所示)圆形Windows等待光标)。我想要
来使它成为可以添加到MVVM应用程序的WPF UserControl。


我已经解决了UserControl部分问题。这是如何在静态图像上绘制彩色3D弧线给我带来麻烦。


这是我正在寻找的效果:


效果开始时只显示灰色环。


彩色3D圆弧开始显示。弧的终点是独立计算的。一个终点比另一个终点慢得多,以至于第二个终点向前跑。


 


最终快速端点赶上较慢的端点。




我可以计算出处理弧内终点的数学算法,但我对如何绘制彩色3D环本身感到困惑。有人可以帮我吗?




Richard Lewis Haggard

解决方案

<你好Richard.Haggard,


根据你的描述,你想创建一个圆形进度条,并想知道如何绘制彩色3D环本身,我发现你可以找到一个样本参考。



最好的问候,


Cherry


I have a WPF application into which I'd like to add a circular wait indicator that has an image as its base and then gets overlaid with a 3D colorful arc whose endpoints move at different rates (like in the standard circular Windows wait cursor). I'd like to make this a WPF UserControl that can be added to an MVVM application.

I've got the UserControl part worked out. It is how to draw the colorful 3D arc on top of the static image that is giving me trouble.

This is the effect that I'm looking for:

The effect starts out just displaying the gray ring.

The colorful 3D arc starts to display. The end points of the arc are independently calculated. One end point moves much slower than the other such that the second endpoint races ahead.

 

Eventually the fast endpoint catches up to the slower one.

I can figure out the math for handling the end points within the arc but I am befuddled by how to draw the colorful 3D ring itself. Can someone help me with that?


Richard Lewis Haggard

解决方案

Hi Richard.Haggard,

According to your description, you want to create circular progressbar, and want to know how to draw the colorful 3D ring itself, I find one sample that you can refer to.

https://github.com/aalitor/WPF_Circular-Progress-Bar

Here is about 3-D Graphics Overview, you can take a look: 

https://docs.microsoft.com/en-us/dotnet/framework/wpf/graphics-multimedia/3-d-graphics-overview

Best Regards,

Cherry


这篇关于如何绘制一个漂亮的循环等待/进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆