包含vb.net硬盘温度的词条( 三 )


If X1 = G Then X1 = 0: y1 = y1 + B: If y1G1 Then Exit Sub
End If
Next i
End Sub
' Super Gauge Car like Speed Display with Leds
Sub SGauge(Pic As PictureBox, x, y, G, fa, Wert, Text)
Dim X1, X2, x3, y1, y2, y3 As Double
PI = 3.1415926543 'Pi
Z = 10
XT = 0 '
G1 = Int(G / 100) 'Our Mesarement ist %, so we build the unit
Gr = G1 * 70 'Z3 is the Radius of the Text, The lines starts from
Z1 = G1 * 110
Z2 = G1 * 130
Z3 = G1 * 90 'Radius Z2 to to radius of Z3
F1 = G1 - 2
If F110 Then F1 = 10 'We care about Font Size, should not be smaller then 10
Pic.FontSize = F1 'Setting the Font
Pic.DrawWidth = 1 'Starting with line a normal thick line
Pic.Circle (x, y), Gr, fa, 5.8, 4# 'Drawing in the inner Circle
A1 = (1.78 * PI) - ((((1.78 * PI) - 1) / 100) * Wert) 'Changing the Value in Wert to an angle
r = 0 'Starting Color is Black
For i = 1.78 * PI To 1 Step -0.0455
X1 = x + Int(sIn(i) * Z1)
y1 = y + Int(Cos(i) * Z1) 'Line From Point
X2 = x + Int(sIn(i) * Z2)
y2 = y + Int(Cos(i) * Z2) 'Line to Point
x3 = x + Int(sIn(i) * Z3)
y3 = y + Int(Cos(i) * Z3) 'Postion of Text
If A1 = i Then 'if our Value Angel is smaler or Equal then bright LEDs
If Wert70 Then fru = H6600 + Wert * 2 Else fru = H33 + Wert * 2
Pic.DrawWidth = 2 'a biger Line is like a LED ;-)
Else
Pic.DrawWidth = 2 'the Small dark line means the LED is off
fru = 0
End If
If Z = 10 Then 'Every Ten line we draw a longer White Line in the Gauge
Pic.DrawWidth = 2
Pic.CurrentX = x3 - 40 - Pic.TextWidth(XT) / 2
Pic.CurrentY = y3 - Pic.TextHeight(XT) / 2 'Calculate the Text Position
Pic.ForeColor = fa
Pic.Print XT
XT = XT + 10 'Dawing Gauge Measerment in steps of 10
Pic.Line (X1, y1)-(X2, y2), fa
'AALine pic.hdc, X1, VarPtr(y1), VarPtr(X2), VarPtr(y2), VarPtr(Fa), 2, 100
Else
Pic.Line (X1, y1)-(X2, y2), (r + fru) '
'AALine pic.hdc, VarPtr(X1), VarPtr(y1), VarPtr(X2), VarPtr(y2), VarPtr(r + fru), 2, 100
End If
Z = Z + 1
If Z10 Then Z = 1
r = H6000
Next i
Pic.FontSize = 8
Pic.CurrentX = x - (Pic.TextWidth(Text) / 2)
Pic.CurrentY = y + G1 * 80
Pic.Print Text
End Sub
'Draws a horizontal Bar, like a Progressbar
Sub Balken(Pic As PictureBox, x, y, G, D, fa, Wert, Text)
Pic.DrawWidth = 1
xf = Pic.TextWidth(Text) + 40
'Wert = 90
Pic.CurrentX = x
Pic.CurrentY = y - 30
Pic.ForeColor = fa
Pic.Print Text
Pic.Line (x + xf, y)-(x + xf + G, y + D), fa, B
G2 = G - 40
D2 = D - 40
L = Int((G2 / 100) * Wert)
If Wert85 Then fa2 = H10000 Else fa2 = H1
X2 = x + 20 + xf
x3 = x + xf + L
For i = 1 To D2 / 2 Step 3
y2 = y + i + 20
'F3 = ((90 + I) * fa2 + H444444)
F3 = RGB(50, 160 + i, 50)
Pic.Line (X2, y2)-(x3, y2), F3
Next i
For i = 1 To D2 / 2 Step 3
y2 = y + (D2 / 2 + i) + 20
'F3 = ((90 + (D2 / 2 - I)) * fa2 + H444444)
F3 = RGB(50, 160 - i, 50)
Pic.Line (X2, y2)-(x3, y2), F3
Next i
End Sub
Sub Balken2(Pic As PictureBox, x, y, G, D, fa, Wert, Text)
Pic.FontSize = 8
Pic.DrawWidth = 1
L = Int((G / 100) * Wert)
xf = Pic.TextHeight(Text) + 40
XB = Pic.TextWidth(Text) / 2
Pic.CurrentX = x - XB
Pic.CurrentY = y - xf - 20
Pic.ForeColor = fa
Pic.Print Str$(Wert) + Text
'pic.Line (x, y)-(x + D, y + g + 14), 0, BF
Pic.Line (x, y)-(x + D, y + G + 14), fa, B
G2 = G - 40
D2 = D - 40
L = Int((G2 / 100) * Wert)
L = Int((G2 / 100) * Wert)
If Wert85 Then fa2 = H10000 Else fa2 = H1
X2 = x + D
y3 = y + G
For i = L To 1 Step -1
F3 = H882222 + (i / 6)
y3 = y + G - i
Pic.Line (x + 10, y3)-(x + D - 10, y3), F3

推荐阅读