Воспользовался поиском (ключевое слово градиент) - ничего нет.
Вопрос, как участок формы залить градиентом
Шурик писал(а):А часть - прямоугольная???
Private Function DrawBackGround(ByVal hCanvas As Object, ByVal lRedStart As Long, ByVal lGreenStart As Long, ByVal lBlueStart As Long, _
ByVal lRedEnd As Long, ByVal lGreenEnd As Long, ByVal lBlueEnd As Long, Optional ByVal lBandHeight As Long = 2)
Dim sngRedCur As Single
Dim sngRedStep As Single
Dim sngGreenCur As Single
Dim sngGreenStep As Single
Dim sngBlueCur As Single
Dim sngBlueStep As Single
Dim lCanvasHeight As Long
Dim lCanvasWidth As Long
Dim lY As Long
Dim iRed As Single
Dim iBlue As Single
Dim iGreen As Single
lCanvasHeight = hCanvas.ScaleHeight
lCanvasWidth = hCanvas.ScaleWidth
sngRedStep = lBandHeight * (lRedEnd - lRedStart) / lCanvasHeight
sngRedCur = lRedStart
sngGreenStep = lBandHeight * (lGreenEnd - lGreenStart) / lCanvasHeight
sngGreenCur = lGreenStart
sngBlueStep = lBandHeight * (lBlueEnd - lBlueStart) / lCanvasHeight
sngBlueCur = lBlueStart
For lY = 0 To lCanvasHeight Step lBandHeight
iRed = sngRedCur
iGreen = sngGreenCur
iBlue = sngBlueCur
hCanvas.Line (-1, lY - 1)-(lCanvasWidth, lY + lBandHeight), RGB(iRed, iGreen, iBlue), BF
sngRedCur = sngRedCur + sngRedStep
sngGreenCur = sngGreenCur + sngGreenStep
sngBlueCur = sngBlueCur + sngBlueStep
Next lY
End Function
Dim r, g, b stp As Integer
Dim x1, y1, x2, y2 As Long
Private Sub Form_Load()
Form1.AutoRedraw = True
Form1.ScaleMode = 3
r = 0: g = 0: b = 0: stp = 1
x1 = 0: y1 = 0: x2 = 100: y2 = 0
For i = 0 To 255 Step stp
Line (x1, y1 + i)-(x2, y2 + i), RGB(r + i, g, b)
Next i
End Sub
Сейчас этот форум просматривают: Bing-бот и гости: 189