估计你是把R值分离出来再显示,就象这个
Private Sub Command1_Click()
Picture1.AutoSize = False
Picture2.AutoSize = False
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
Picture1.ScaleMode = 3
Picture2.ScaleMode = 3
CommonDialog1.ShowOpen
Picture1.Picture = LoadPicture(CommonDialog1.FileName)
End Sub
Private Sub Command2_Click()
Dim i, j As Integer
Dim r, g, b As Integer
Dim color As Long
For i = 0 To Picture1.ScaleWidth
For j = 0 To Picture1.ScaleHeight
color = Picture1.Point(i, j)
r = (color And &HFF&)
g = (color And &HFF00&) \ 256&
b = (color And &HFF0000) \ 65536
Select Case Text1.Text
Case Is = "r"
Picture2.PSet (i, j), RGB(r, 0, 0)
Case Is = "g"
Picture2.PSet (i, j), RGB(0, g, 0)
Case Is = "b"
Picture2.PSet (i, j), RGB(0, 0, b)
Case Is = "c"
Picture2.PSet (i, j), RGB(r, g, b)
End Select
Next j
Next i
Picture2.Refresh
End Sub
根据text1.text决定显示r,g,b通道或彩色
你应该用强度分层法来显示伪彩色。比如把灰度分为n级,每一级采用一种颜色。