【发布时间】:2014-01-07 14:33:28
【问题描述】:
我需要在 C# 的图片框中显示这个 double 数组
double[,] Y1 = new double[width, height];//not empty array contain brightness from RGB
R = new byte [width, height];
G = new byte [width, height];
B = new byte [width, height];
Bitmap bmp4 = new Bitmap(width, height);
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
Y1[x, y] = (0.39 * R[x,y]) + (0.59 * G[x,y]) + (0.12 * B[x,y]);
Int32 zz = Convert.ToInt32(Y1[x, y]);
bmp4.SetPixel(x, y, zz);
}
}
pictureBox6.Image=bmp4;
我使用此代码进行显示但不起作用是否有其他显示数组的方法
double(Brightness)在图片框中(bmp文件)
【问题讨论】:
-
@Brandon,无法在“colors[x,y]=(Color)zz;”中将整数转换为颜色
-
使用 Color.FromArgb(zz);
-
@Brandon,我使用 Color.FromArgb(zz) 但图片不显示,为什么?
-
我要输入一个答案,因为我已经弄清楚你想要做什么......等等。
标签: c# bitmap rgb picturebox brightness