Jumat, 18 Juni 2010
2
[VB] Membuat Air Brush Sederhana
Deklarasi:
1 Form
Dim DrawOn As Boolean, Color As Variant
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
DrawOn = True
Call Brush(X, Y, vbBlue)
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If DrawOn Then Call Brush(X, Y, vbBlue)
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
DrawOn = False
End If
End Sub
Sub Brush(X As Single, Y As Single, Color As Variant)
Dim rndX, rndY As Single
Randomize Timer 'Mengacak koordinat titik brush
For i = 0 To 30 'Menyemprotkan Brush sebanyak 30 titik
rndX = Int(((X + 100) - (X - 100) + 1) * Rnd) + (X - 100)
rndY = Int(((Y + 100) - (Y - 100) + 1) * Rnd) + (Y - 100)
Me.PSet (rndX, rndY), Color
Next i
End Sub
Private Sub Form_load()
Me.AutoRedraw = True
End Sub
Langganan:
Posting Komentar (Atom)
2 Komentar Untuk “[VB] Membuat Air Brush Sederhana”
Kamis, 16 Desember 2010 pukul 14.13.00 WIB
Itu make apaan?
Punya q yg Borland Delphi codingnya gimana???
Kamis, 16 Desember 2010 pukul 18.00.00 WIB
@andri: Pake visual basic 6 gan,, berbagai source code delphi akan saya masukkan,, semoga saja ada source code air brush nya... ok
Posting Komentar
Berikan komentar positif tentang artikel yang sederhana ini niscaya sobat akan mendapatkan balasannya. Hehehe