返回列表 发帖

如何把调色板调出的颜色赋值给画笔?

[这个贴子最后由Yuki在 2003/10/19 01:32pm 第 1 次编辑]

我做的一个画板   (VB)
望各位能帮帮忙看看

还有些没做好(不会做了望各位大哥能指教一下)

源程序
Dim paint As Boolean
Dim x0 As Integer
Dim y0 As Integer
Private Sub Form_Load()
    DrawWidth = 3                         '定义画笔大小
    ForeColor = RGB(0, 255, 255)          '定义画笔颜色
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
   paint = True
   x0 = X:  y0 = Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If paint Then
    Line (X, Y)-(x0, y0)
      x0 = X: y0 = Y
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
   paint = flase
End Sub

以下为调色板

Private Sub HScroll1_Change()
Label1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_Change()
Label1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_Change()
Label1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub

请问一下
如何把调色板调出的颜色赋值给画笔?????

(小弟很菜,不要踩哦)

如何把调色板调出的颜色赋值给画笔?

论坛不支持RAR文件上传吗
我的画板无法上传

TOP

返回列表 回复 发帖