问题描述
位图bm =新位图(sourceFilename);
for(i = 0; i< bm.Width; i ++)
{
for(j = 0; j< bm.Height; j ++)
{
颜色pixelColor =
a =(pixelColor.R;
b =(pixelColor.B);
c =( pixelColor.G);
}
}
a,b,对于每个像素,必须以2维数组的形式复制c值。假设..有100个像素。一行10个......当我们为每个像素取rgb值时......我们每行有300个。 ..
所以iwill是300X100 2d数组,其中行为100,列为300
Bitmap bm = new Bitmap(sourceFilename);
for (i = 0; i < bm.Width; i++)
{
for (j = 0; j < bm.Height; j++)
{
Color pixelColor =
a=(pixelColor.R ;
b=(pixelColor.B );
c=(pixelColor.G );
}
}
a,b,c values have to be copied in a 2 dimesional array for each pixel..suppose..there are 100 pixels..each 10 in one row...when we take rgb values for each pixel..we have 300 in each row...
so iwill be 300X100 2d array where rows are 100 and columns are 300
这篇关于如何在2维数组中复制像素的每个RGB值..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!