圆环进度条中的光盘已用空间控件






4.89/5 (14投票s)
这个圆环进度条显示 DVD 或 CD 的已用空间。

引言
你好!
我认为刻录应用程序应该以一种吸引人的方式向用户显示磁盘(DVD/CD)的已用空间,例如使用这种控件。
背景
使用此控件,您可以找到 DVD 的已用空间,显示在圆形进度条控件中。
例如,Nero 希望向用户显示 DVD/CD 的已用空间。 这是最好的方式,虽然它并不完美,但没有什么是完美的。
控件属性和方法
以下是主要属性列表
磁盘类型
使用此属性更改磁盘类型
例如:从 DVD(4500 MB)更改为 CD(700 MB)Valuemb
磁盘容量,单位为 MB
Using the Code
现在让我们看看代码
'used variables
' l_1 is the main circle
' l_2 is the second circle
' l_3 is the third circle (smallest)
' l_4 is tells you for used space of disc
' d is diameter of l_1
' d2 is diameter of l_2
' d3 is diameter of l_3
' d4 is diameter of l_4
' d_temp is distance between l_1 and l_4
' p is the center of the form
' dim p as integer = me.width/2
' 'we use only p coordinate because width=height
Dim a as Double 'this value will be percentage of used space
'If type of Disc is DVD
a=(100 * Val(value_mb)) / 4500 ' valuemb is your value in mb
Dim d_temp As Integer
d_temp = d - (d / 4) 'distance between l_1 and l_4
d_per = ((a / 100) * d_temp) + d2 'diameter of l_4(used space circle)
r_per = d_per / 2 'radius of l_4(used space circle)
'Now we draw l_4 (used space circle)
e.Graphics.FillEllipse(color1, p - r_per, p - r_per, d_per, d_per)
'If type of Disc is CD
a=(100 * Val(value_mb)) / 700 ' valuemb is your value in mb
Dim d_temp As Integer
d_temp = d - (d / 4) 'distance between l_1 and l_4
d_per = ((a / 100) * d_temp) + d2 'diameter of l_4(used space circle)
r_per = d_per / 2 'radius of l_4(used space circle)
'Now we draw l_4 (used space circle)
e.Graphics.FillEllipse(color1, p - r_per, p - r_per, d_per, d_per)
在调整控件宽度时,宽度必须等于高度
Me.Width = Me.Height
Me.Height = Me.Width
历史
- 版本 1.0 - 2009年2月28日