home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD838.psc / VBPrg / MemoryGame / BoxGradientMod.bas next >
Encoding:
BASIC Source File  |  1999-09-13  |  815 b   |  29 lines

  1. Attribute VB_Name = "BoxGradientMod"
  2. Option Explicit
  3.  
  4. Public Sub BoxGradient(OBJ As Object, R%, G%, B%, RStep%, GStep%, BStep%, Direc As Boolean)
  5. Dim s%, xpos%, ypos%
  6. OBJ.ScaleMode = 3 'pixel
  7. If Direc = True Then
  8. RStep% = -RStep%
  9. GStep% = -GStep%
  10. BStep% = -BStep%
  11. End If
  12. DoBox:
  13. s% = s% + 1
  14. If xpos% < Int(OBJ.ScaleWidth / 2) Then xpos% = s%
  15. If ypos% < Int(OBJ.ScaleHeight / 2) Then ypos% = s%
  16. OBJ.Line (xpos%, ypos%)-(OBJ.ScaleWidth - xpos%, OBJ.ScaleHeight - ypos%), RGB(R%, G%, B%), B
  17. R% = R% - RStep%
  18. If R% < 0 Then R% = 0
  19. If R% > 255 Then R% = 255
  20. G% = G% - GStep%
  21. If G% < 0 Then G% = 0
  22. If G% > 255 Then G% = 255
  23. B% = B% - BStep%
  24. If B% < 0 Then B% = 0
  25. If B% > 255 Then B% = 255
  26. If xpos% = Int(OBJ.ScaleWidth / 2) And ypos% = Int(OBJ.ScaleHeight / 2) Then Exit Sub
  27. GoTo DoBox
  28. End Sub
  29.