Gradient draw using VB 6.0

Gradient

Public r1 As Integer, g1 As Integer, b1 As Integer
Public r2 As Integer, g2 As Integer, b2 As Integer

Public Sub DrawGradient(frm As Form)

Dim R As Integer, G As Integer, B As Integer
Dim i As Integer
frm.Cls
For i = 0 To 100
R = r1 – (((r1 – r2) / 100) * i)
G = g1 – (((g1 – g2) / 100) * i)
B = b1 – (((b1 – b2) / 100) * i)
frm.Line (0, (frm.ScaleHeight / 100) * i)-(frm.ScaleWidth, (frm.ScaleHeight / 100) * i), RGB(R, G, B)
Next i
End Sub
Public Sub WhiteBlue(frm As Form)
r1 = 255
g1 = 255
b1 = 255

r2 = 245
g2 = 200
b2 = 63

frm.Cls
Call DrawGradient(frm)
End Sub

Private Sub Form_Load()

Call WhiteBlue(frmStartUp)

End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s