Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing Form3.frm (1.33 KB)
VERSION 5.00
Begin VB.Form Form3
BorderStyle = 4 'Fixed ToolWindow
Caption = "RGB Fader"
ClientHeight = 3195
ClientLeft = 45
ClientTop = 285
ClientWidth = 1770
ClipControls = 0 'False
Icon = "Form3.frx":0000
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 1770
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Sub DoGradient(ByVal Obj As Object, _
ByVal R1, ByVal G1, ByVal B1, ByVal R2, ByVal G2, ByVal B2)
Dim i As Integer, Y As Integer
Dim Ri, Gi, Bi
With Obj
.AutoRedraw = True
.DrawStyle = 6
.DrawMode = 13
.DrawWidth = 2
.ScaleMode = 3
.ScaleHeight = 512
End With
Ri = (R2 - R1) / 256
Gi = (G2 - G1) / 256
Bi = (B2 - B1) / 256
For i = 0 To 255
R1 = R1 + Ri
G1 = G1 + Gi
B1 = B1 + Bi
If R1 < 0 Then R1 = 0
If R1 > 255 Then R1 = 255
If G1 < 0 Then G1 = 0
If G1 > 255 Then G1 = 255
If B1 < 0 Then B1 = 0
If B1 > 255 Then B1 = 255
Obj.Line (0, Y)-(Obj.Width, Y + 2), RGB(R1, G1, B1), BF
Y = Y + 2
DoEvents
Next i
End Sub