如何搭配rgb实现颜色渐变就像360那样的界面渐变效果。告诉我rgb的值
发布网友
发布时间:2022-04-29 01:14
我来回答
共1个回答
热心网友
时间:2022-06-27 07:31
Option Explicit
Dim iCurr As Integer
Private Sub Form_Activate()
Dim i As Long, W As Long
W = Width
For i = 0 To Width Step 1
Line (i, 0)-(i, Height), RGB((255 - i / W * 255) * 2, i / W * 255 * 2, 0)
Debug.Print Int(i / W * 255)
Next
End Sub
Private Sub HScroll1_change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll1_Scroll()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_Scroll()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_Scroll()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub