аля фотошоп
Option Explicit
Private Function Grad4(P As PictureBox, X As Long, Y As Long, W As Long, H As Long, rc, gc, bc)
Dim R As Integer, G As Integer, B As Integer
Dim i As Long, j As Long
For i = 0 To W - 1
For j = 0 To H - 1
R = (((100 / H) * j) / 100) + (rc * (((100 / W) * i) / 100) + 255 * ((100 - (100 / W) * i) / 100)) * ((100 - (100 / H) * j) / 100)
G = (((100 / H) * j) / 100) + (gc * (((100 / W) * i) / 100) + 255 * ((100 - (100 / W) * i) / 100)) * ((100 - (100 / H) * j) / 100)
B = (((100 / H) * j) / 100) + (bc * (((100 / W) * i) / 100) + 255 * ((100 - (100 / W) * i) / 100)) * ((100 - (100 / H) * j) / 100)
P.PSet (i, j), RGB(R, G, B)
Next
Next
End Function
Private Sub Form_Click()
Grad4 PB, 0, 0, PB.ScaleWidth, PB.ScaleHeight, 255, 0, 0
End Sub