用line,从上向下画线,当然要由浅至深,就是你要的效果了

解决方案 »

  1.   

        Const intBLUESTART% = 255
        Const intBLUEEND% = 0
        Const intBANDHEIGHT% = 2
        Const intSHADOWSTART% = 8
        Const intSHADOWCOLOR% = 0
        Const intTEXTSTART% = 4
        Const intTEXTCOLOR% = 15
        Const intRed% = 1
        Const intGreen% = 2
        Const intBlue% = 4
        Const intBackRed% = 8
        Const intBackGreen% = 16
        Const intBackBlue% = 32
        Dim sngBlueCur As Single
        Dim sngBlueStep As Single
        Dim intFormHeight As Integer
        Dim intFormWidth As Integer
        Dim intY As Integer
        Dim iColor As Integer
        Dim iRed As Single, iBlue As Single, iGreen As Single
        
        '
        'Get system values for height and width
        '
        intFormHeight = ScaleHeight
        intFormWidth = ScaleWidth    iColor = 3
        'Calculate step size and blue start value
        '
        sngBlueStep = intBANDHEIGHT * (intBLUEEND - intBLUESTART) / intFormHeight
        sngBlueCur = intBLUESTART    '
        'Paint blue screen
        '
        For intY = 0 To intFormHeight Step intBANDHEIGHT
            If iColor And intBlue Then iBlue = sngBlueCur
            If iColor And intRed Then iRed = sngBlueCur
            If iColor And intGreen Then iGreen = sngBlueCur
            If iColor And intBackBlue Then iBlue = 255 - sngBlueCur
            If iColor And intBackRed Then iRed = 255 - sngBlueCur
            If iColor And intBackGreen Then iGreen = 255 - sngBlueCur
            Line (-1, intY - 1)-(intFormWidth, intY + intBANDHEIGHT), RGB(iRed, iGreen, iBlue), BF
            sngBlueCur = sngBlueCur + sngBlueStep
        Next intY    CurrentX = intSHADOWSTART
        CurrentY = intSHADOWSTART
        ForeColor = QBColor(intSHADOWCOLOR)
        CurrentX = intTEXTSTART
        CurrentY = intTEXTSTART
        ForeColor = QBColor(intTEXTCOLOR)
      

  2.   

    bucher(bucher) 说的极是
    AutoRedraw =true '否则一擦就没有了
      

  3.   

    Private Sub Form_Resize()
       Gradient Me, 130, 256, 50, 0 '使用gradient函数渐变Form
    End SubSub Gradient(TheObject As Object, Redval&, Greenval&, Blueval&, TopToBottom As Boolean)  'TheObject 可以是PictureBox图片框或Form表单
      'Redval, Greenval, Blueval 是红、绿、蓝三色开始值,从0-255
      'TopToBottom 确定画渐变的方向  Dim Step%, Reps%, FillTop%, FillLeft%, FillRight%, FillBottom%, HColor$
       Step = (TheObject.Height / 63)
       If TopToBottom = True Then FillTop = 0 Else FillTop = TheObject.Height - Step
          FillLeft = 0
          FillRight = TheObject.Width
          FillBottom = FillTop + Step
          For Reps = 1 To 63
          '画线
          TheObject.Line (FillLeft, FillTop)-(FillRight, FillBottom), RGB(Redval, Greenval, Blueval), BF
          Redval = Redval - 4
          Greenval = Greenval - 4
          Blueval = Blueval - 4      If Redval <= 0 Then Redval = 0
          If Greenval <= 0 Then Greenval = 0
          If Blueval <= 0 Then Blueval = 0
          If TopToBottom = True Then FillTop = FillBottom Else FillTop = FillTop - Step
          FillBottom = FillTop + Step
          Next
    End Sub
      

  4.   

    Private Sub Form_Activate()
    For i = 0 To Me.ScaleHeight
        Line (0, i)-(Me.ScaleWidth, i), RGB(255 - 255 / Me.ScaleHeight * i, 255 - 255 / Me.ScaleHeight * i, 0)
    Next
    End Sub