VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



It's amazing what you can do with lines

by ReXz (9 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

This code draws something wierd...but cool! Lines rules! =)

Inputs
two timers called 'timer1' and 'timer2' and interval : 1, scalemode : pixel, Backcolor : black
API Declarations
Dim Color As Integer, lx2 As Integer, lx1 As Integer

Rate It's amazing what you can do with lines

Private Sub Form_Load()
lx2 = Me.ScaleWidth
Color = 0
End Sub
Private Sub Timer1_Timer()
Color = Color + 1
If Color < 255 Then
Me.ForeColor = RGB(Color, 0, 0)
lx1 = lx1 + 3
lx2 = lx2 - 3
Me.Line (lx1, Me.ScaleLeft)-(lx1, Me.ScaleWidth)
Me.Line (lx2, Me.ScaleWidth)-(lx2, Me.ScaleLeft)
Me.Line (0, lx1)-(Me.ScaleWidth, lx1)
Me.Line (Me.ScaleHeight, lx1)-(Me.ScaleTop, lx2)
ElseIf Color > 254 Then
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Color = Color - 1
If Color > 1 Then
Me.ForeColor = RGB(Color, 0, 0)
lx1 = lx1 + 3
lx2 = lx2 - 3
Me.Line (lx1, Me.ScaleLeft)-(lx1, Me.ScaleWidth)
Me.Line (lx2, Me.ScaleWidth)-(lx2, Me.ScaleLeft)
Me.Line (0, lx1)-(Me.ScaleWidth, lx1)
Me.Line (Me.ScaleHeight, lx1)-(Me.ScaleTop, lx2)
ElseIf Color < 1 Then
Timer2.Enabled = False
End If
End Sub

Download this snippet    Add to My Saved Code

It's amazing what you can do with lines Comments

No comments have been posted about It's amazing what you can do with lines. Why not be the first to post a comment about It's amazing what you can do with lines.

Post your comment

Subject:
Message:
0/1000 characters