s = 2154109(这个值你可以由其它方法获得)
r = s Mod 256 '分离出红色
g = (s \ 256) Mod 256 '分离出绿色
b = s \ 256 \ 256 '分离出蓝色
举个例子吧
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)'图片框中有图的,要不始终显示一个值
Dim s As Long
Dim r As Long
Dim g As Long
Dim b As Long
If Button = 1 Then
s = Picture1.Point(X, Y) '得到图片上位置的色度值
r = s Mod 256 '分离出红色
g = (s \ 256) Mod 256 '分离出绿色
b = s \ 256 \ 256 '分离出蓝色
Text1(0).Text = r '显示红色分量
Text1(1).Text = g '显示绿色分量
Text1(2).Text = b '显示蓝色分量
Picture2.BackColor = RGB(r, g, b) '在另一个图片框中显示此颜色
End If
End Sub