I made a program to get all image pixel RGB color codes from picture. Basically, it sets y position on constant and changes x position zero to width and also y by looping.
Ok it's work, but the problem is it take more than 20 minutes to get all pixel from even (1000*604 height width) image. Please anyone help?
I'm surprised if this process takes so long, then how can we make a program like bar-code reader from image. I want to get all pixel value from image, here is my C# code are below.
I also uploaded my program here, check it if you don't agree.
void myimage() {
mypic = new Bitmap(pathname);
int imwid = mypic.Width;
int imhei = mypic.Height;
int total=imwid*imhei;
for (int z = 0; z <imhei;z++ )
{
for (int i = 0; i < imwid; i++)
{
Color pixelColor = mypic.GetPixel(i, z);
textBox2.AppendText(" " + pixelColor.R +
" " + pixelColor.G +
" " + pixelColor.B + " " +
pixelColor.A +
Environment.NewLine);
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…