
正文
vb.net调色板,用vb做一个调色板程序
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
用VB.net编写一个调色板
'vb.net自带ColorDialog
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
ColorDialog1.ShowDialog()
TextBox2.BackColor = ColorDialog1.Color
End Sub
相关问答
Q1: vb.net怎么编写调色板
以前写过一个 留个邮箱我发给你看看吧 有不懂的追问
这是在外部用的 如果你想直接在程序中像.net自带的ColorPicker那样的可以把这个稍微改一下就行(加个确认,取消按钮) 像这样:
Q2: vb.net拾色器设计,要求:能获取图片任意位置的颜色
VB可使用Point方法来获取图片指定点的颜色。
Point 方法
按照长整数,返回在 Form 或 PictureBox 上所指定磅的红-绿-蓝 (RGB) 颜色。
语法
object.Point(x, y)
'窗体判色代码:
Private Sub Form1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1 = X
Text2 = Y
Text3 = Point(X, Y)
Text4 = (Val(Text3) Mod 65536) Mod 256 'Red
Text5 = (Val(Text3) Mod 65536) \ 256 'Green
Text6 = Val(Text3) \ 65536 'Blue
Shape1.FillColor = RGB(Val(Text4), Val(Text5), Val(Text6))
End Sub
'PictureBox判色代码:
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1 = X
Text2 = Y
Text3 = Picture1.Point(X, Y)
Text4 = (Val(Text3) Mod 65536) Mod 256 'Red
Text5 = (Val(Text3) Mod 65536) \ 256 'Green
Text6 = Val(Text3) \ 65536 'Blue
Shape1.FillColor = RGB(Val(Text4), Val(Text5), Val(Text6))
End Sub







