本文介绍了我试着转换Black&白色图像使用RGB颜色矩阵彩色图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Here is my simple code but it give me nothing altho the RGB values are in the program:
'-------------------------------------Picture color change--------------------
Dim bm As Bitmap = New Bitmap("C:\trash\Babymono100.bmp")
Dim x
Dim y
For y = 0 To bm.Height - 1
For x = 0 To bm.Width - 1
Dim c As Color = bm.GetPixel(x, y)
TextBox1.Text = c.R
For i = 1 To 10000
If c.R = DataGridViewGray.Rows(i).Cells(1).Value Then
bm.SetPixel(x, y, Color.FromArgb(DataGridViewRed.Rows(i).Cells(1).Value, DataGridViewGreen.Rows(i).Cells(1).Value, DataGridViewBlue.Rows(i).Cells(1).Value))
Exit For
End If
Next
Next
Next
PictureBox1.Image = bm
'我已经有4种不同的DataGridView for GrayScale,红色,绿色和蓝色
我只需要确定与所选GrayScale颜色相关的3 RGB颜色
'I have Already 4 different DataGridView for GrayScale,Red,Green and Blue colors
I just need to determine the 3 RGB color related to the selected GrayScale color
推荐答案
这篇关于我试着转换Black&白色图像使用RGB颜色矩阵彩色图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!