WAP for developing paint brush in VB.
_______________________________
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
With Combo1
.AddItem 1
.AddItem 2
.AddItem 4
.AddItem 8
.AddItem 16
.AddItem 32
.AddItem 64
End With
Combo1.ListIndex = 0
With Combo2
.AddItem "Black"
.AddItem "Red"
.AddItem "Green"
.AddItem "Blue"
.AddItem "White"
End With
Combo2.ListIndex = 0
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
Picture1.CurrentX = x
Picture1.CurrentY = Y
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
Dim colour As String
If Button = 1 Then
Picture1.DrawWidth = Combo1.text
If Combo2.text = "Black" Then colour = vbBlack
If Combo2.text = "Red" Then colour = vbRed
If Combo2.text = "Green" Then colour = vbGreen
If Combo2.text = "Blue" Then colour = vbBlue
If Combo2.text = "White" Then colour = vbWhite
Picture1.Line (Picture1.CurrentX, Picture1.CurrentY)-(x, Y), colour
End If
End Sub
____________________________________
OUTPUT
____________________________________
____________________________________
DOWNLOAD
____________________________________
Download its form
Download its Image
No comments:
Post a Comment