VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Metallic Formsupdated

by John Edward Colman (7 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (10 Votes)

Cut and Paste code... Turns your flat form into a metalic cylinder. Setting the AutoRedraw property is now done for you. Also thanks to Sebastjan for his tip about setting the ScaleMode to pixels.

Rate Metallic Formsupdated

Private Sub GradientFill()
 Dim i As Long
 Dim c As Integer
 Dim r As Double
 r = ScaleHeight / 3.142
 'Hint: Multiplying r by differnt values give different effects (try 2.3)
 For i = 0 To ScaleHeight
  c = Abs(220 * Sin(i / r))
  'Hint: Changing sin to cos reverses range
  Me.Line (0, i)-(ScaleWidth, i), RGB(c, c, c + 30)
  'Hint: Notice the bias to blue. You can be more subtle by reducing this number (try 10). Try other colours too.
 Next
End Sub
Private Sub Form_Load()
 Me.ScaleMode = 3
 Me.AutoRedraw = True
End Sub
Private Sub Form_Resize()
 GradientFill
End Sub

Download this snippet    Add to My Saved Code

Metallic Formsupdated Comments

No comments have been posted about Metallic Formsupdated. Why not be the first to post a comment about Metallic Formsupdated.

Post your comment

Subject:
Message:
0/1000 characters