Visualization VB.Net

alfa6661
- December 24, 2011
0 (0 votes)
Rate :
Potongan kode sederhana untuk membuat visualization di VB.Net. visualization adalah grafik visual yang berubah-ubah yang biasanya tersedia pada software-software media playe

Artikel ini merupakan potongan kode sederhana untuk membuat visualization di VB.Net. visualization adalah grafik visual yang berubah-ubah yang biasanya tersedia pada software-software media player.

Syntax

Public Class Form1
 
    Dim g As Graphics
    Dim p As New Pen(Color.DarkGreen, 5)
    Dim r As Random = New Random()
 
    Sub Change()
        Dim x As Integer = 0
        For x = 0 To 25
            Select Case r.Next(0, 10)
                Case x
                    p = New Pen(Color.DarkGreen, 5)
            End Select
        Next
    End Sub
 
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
 
        g = PictureBox1.CreateGraphics()
        Change()
        Dim i, a, o As Integer
        For x As Integer = 0 To 100
            g.DrawLine(p, i, Me.Height, i, r.Next(o, Me.Height * a))
            Change()
            i = i + 5
            a = a + 1
            o = o * 3
        Next
 
        System.Threading.Thread.Sleep(200)
        g.Clear(Color.Black)
 
    End Sub
 
End Class

Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter

– Eric S. Raymond

Have a better explanation?

If you have comments about this post. Please write your comments below

No comments associated with this article