用vb做一个画图板,要求要能画,直线,曲线,矩形,圆。能调画笔的粗细,还有用滚轮调色。求解答啊! 10
3个回答
展开全部
用VB做的一个简单windows画图板,具有画图板的基本功
http://www.pudn.com/downloads168/sourcecode/others/detail776118.html
http://www.pudn.com/downloads168/sourcecode/others/detail776118.html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim t As Byte, s As Byte, c As Byte
Private Sub Command1_Click()
t = 1
If Form1.ForeColor = Form1.BackColor Then ForeColor = QBColor(c)
If Form1.DrawWidth = 12 Then Form1.DrawWidth = s
End Sub
Private Sub Command2_Click()
Form1.DrawWidth = 12
t = 2
End Sub
Private Sub Command3_Click()
Cls
Form1.ForeColor = vbBlack
Form1.DrawWidth = 1
t = 1
End Sub
Private Sub Form_Load()
Dim i%
For i = 0 To 15
Picture1(i).BackColor = QBColor(i)
Next i
Form1.ForeColor = vbBlack
t = 1
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CurrentX = X: CurrentY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 And t = 1 Then Line -(X, Y)
If Button = 1 And t = 2 Then Form1.ForeColor = Form1.BackColor: Form1.MousePointer = 4: Line -(X, Y)
End Sub
Private Sub Picture1_Click(Index As Integer)
Form1.ForeColor = Picture1(Index).BackColor
c = Index
End Sub
Private Sub Picture2_Click()
Form1.DrawWidth = 1: s = 1
End Sub
Private Sub Picture3_Click()
Form1.DrawWidth = 2: s = 2
End Sub
Private Sub Picture4_Click()
Form1.DrawWidth = 4: s = 4
End Sub
Private Sub Picture5_Click()
Form1.DrawWidth = 8: s = 8
End Sub
Private Sub Command1_Click()
t = 1
If Form1.ForeColor = Form1.BackColor Then ForeColor = QBColor(c)
If Form1.DrawWidth = 12 Then Form1.DrawWidth = s
End Sub
Private Sub Command2_Click()
Form1.DrawWidth = 12
t = 2
End Sub
Private Sub Command3_Click()
Cls
Form1.ForeColor = vbBlack
Form1.DrawWidth = 1
t = 1
End Sub
Private Sub Form_Load()
Dim i%
For i = 0 To 15
Picture1(i).BackColor = QBColor(i)
Next i
Form1.ForeColor = vbBlack
t = 1
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CurrentX = X: CurrentY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 And t = 1 Then Line -(X, Y)
If Button = 1 And t = 2 Then Form1.ForeColor = Form1.BackColor: Form1.MousePointer = 4: Line -(X, Y)
End Sub
Private Sub Picture1_Click(Index As Integer)
Form1.ForeColor = Picture1(Index).BackColor
c = Index
End Sub
Private Sub Picture2_Click()
Form1.DrawWidth = 1: s = 1
End Sub
Private Sub Picture3_Click()
Form1.DrawWidth = 2: s = 2
End Sub
Private Sub Picture4_Click()
Form1.DrawWidth = 4: s = 4
End Sub
Private Sub Picture5_Click()
Form1.DrawWidth = 8: s = 8
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询