| Public blue(10000) Public green(10000) Public red(10000) Public Sub Fade_Box(PB As PictureBox, color1, color2) blue(0) = 0 green(0) = 0 red(0) = 0 atemp = Hex(color1) btemp = Hex(color2) If Len(atemp) = 4 Then atemp = "00" & atemp End If If Len(atemp) = 2 Then atemp = "0000" & atemp End If If Len(btemp) = 4 Then btemp = "00" & btemp End If If Len(btemp) = 2 Then btemp = "0000" & btemp End If If HexCon(Left(atemp, 2)) = HexCon(Left(btemp, 2)) Then For X = 1 To PB.ScaleWidth blue(X) = Left(atemp, 2) blue(0) = PB.ScaleWidth Next Else For X = HexCon(Left(atemp, 2)) To HexCon(Left(btemp, 2)) Step (HexCon(Left(btemp, 2)) - HexCon(Left(atemp, 2))) / PB.ScaleWidth blue(0) = blue(0) + 1 ntemp = Hex(X) If Len(ntemp) = 1 Then ntemp = "0" & ntemp End If blue(blue(0)) = ntemp Next End If If HexCon(Right(Left(atemp, 4), 2)) = HexCon(Right(Left(btemp, 4), 2)) Then For X = 1 To PB.ScaleWidth green(X) = Right(Left(atemp, 4), 2) green(0) = PB.ScaleWidth Next Else For X = HexCon(Right(Left(atemp, 4), 2)) To HexCon(Right(Left(btemp, 4), 2)) Step (HexCon(Right(Left(btemp, 4), 2)) - HexCon(Right(Left(atemp, 4), 2))) / PB.ScaleWidth green(0) = green(0) + 1 ntemp = Hex(X) If Len(ntemp) = 1 Then ntemp = "0" & ntemp End If green(green(0)) = ntemp Next End If If HexCon(Right(atemp, 2)) = HexCon(Right(btemp, 2)) Then For X = 1 To PB.ScaleWidth red(X) = Right(atemp, 2) red(0) = PB.ScaleWidth Next Else For X = HexCon(Right(atemp, 2)) To HexCon(Right(btemp, 2)) Step (HexCon(Right(btemp, 2)) - HexCon(Right(atemp, 2))) / PB.ScaleWidth red(0) = red(0) + 1 ntemp = Hex(X) If Len(ntemp) = 1 Then ntemp = "0" & ntemp End If red(red(0)) = ntemp Next End If Z = 0 For X = 0 To PB.ScaleWidth Z = Z + 1 For Y = 0 To PB.ScaleHeight On Error Resume Next PB.ForeColor = "&H" & blue(Z) & green(Z) & red(Z) PB.PSet (X, Y) Next Next End Sub Private Function HexCon(HexText) X = LCase(Right(HexText, 1)) Y = LCase(Left(HexText, 1)) If X = "a" Then X = 10 ElseIf X = "b" Then X = 11 ElseIf X = "c" Then X = 12 ElseIf X = "d" Then X = 13 ElseIf X = "e" Then X = 14 ElseIf X = "f" Then X = 15 End If If Y = "a" Then Y = 10 ElseIf Y = "b" Then Y = 11 ElseIf Y = "c" Then Y = 12 ElseIf Y = "d" Then Y = 13 ElseIf Y = "e" Then Y = 14 ElseIf Y = "f" Then Y = 15 End If ntemp = (Y * 16) + X HexCon = ntemp End Function
Ha! Figure that out †ô/\/\ you smartass... Well 2 all the rest of you out there who dont hait me. Love ya, but now i must smoke...Later dayz |