Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Visual Basic 2008 - Cool Animation

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
9,749
Loading...
Alert icon
Sign in or sign up now!
Alert icon
Ratings have been disabled for this video.

Uploaded by on Jan 31, 2010

Imports System
Imports System.Drawing
Imports System.Drawing.Printing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Drawing.Drawing2D
Public Class Form3 Public Sub Draw(ByVal g As Graphics) g.SmoothingMode = SmoothingMode.AntiAlias Dim rect As Rectangle = Me.ClientRectangle Dim cx As Integer = rect.Width Dim cy As Integer = rect.Height Dim scale As Single = CSng(cy) / CSng(cx) Dim _brush As LinearGradientBrush = New LinearGradientBrush(Me.ClientRectangle, Color.Empty, Color.Empty, 45) Dim blend As ColorBlend = New ColorBlend() blend.Colors = New Color() {Color.Red, Color.Green, Color.Blue} blend.Positions = New Single() {0.0, 0.5, 1.0} _brush.InterpolationColors = blend Dim _pen As Pen = New Pen(_brush) Dim x As Integer For x = 0 To cx Step 7 g.DrawLine(_pen, 0, x * scale, cx - x, 0) g.DrawLine(_pen, 0, (cx - x) * scale, cx - x, cx * scale) g.DrawLine(_pen, cx - x, 0 * scale, cx, (cx - x) * scale) g.DrawLine(_pen, cx - x, cx * scale, cx, x * scale) Next Dim format As StringFormat = New StringFormat() format.Alignment = StringAlignment.Center format.LineAlignment = StringAlignment.Center Dim s As String = "Ain't graphics cool?" g.DrawString(s, Me.Font, _brush, rect.X, rect.Y, format) End Sub Private Sub MyPaint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Dim g As Graphics = e.Graphics Draw(g) End Sub Shared Sub Main() Dim myform As Form = New Form3() Application.Run(myform) End Sub
End Class

Category:

Education

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:

Top Comments

  • whats with the squeeking in the background???

  • @mymidnightsnack dude it sounds like a girl cuz of her voice (or his voice) no i am not deaf you must be.

see all

All Comments (27)

Sign In or Sign Up now to post a comment!
  • good

  • now how do you make it loop infinitely?

  • I can do better :p

    

  • @adminmarkus cause i changed the Form3's in the description to form1, it worked perfectly

  • im nooob :)

  • @CallOfCupcakes prison mice/rats

  • kool

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more