rendered paste bodypublic void Work() {
while (this.Created) {
m_ip = cam.Click();
image = new Bitmap(cam.Width, cam.Height, cam.Stride, PixelFormat.Format24bppRgb, m_ip);
image.RotateFlip(RotateFlipType.RotateNoneFlipY);
old = senis;
senis = image;
#region Draw background
#endregion
#region Checking
if (old != null) {
for (int x = 0; (x + 32) < image.Width; x += 32) {
//vertical
for (int y = 0; (y + 30) < image.Height; y += 30) {
//need to get image
Rectangle r = new Rectangle(x, y, 32, 30);
int count = 0;
int value1 = 0;
int value2 = 0;
for (int i = 0; i < r.Width; i++) {
for (int n = 0; n < r.Height; n++) {
Color nPixel = image.GetPixel(x + i, y + n);
Color oPixel = image.GetPixel(x + i, y + n);
value1 += (int)nPixel.G;
value2 += (int)oPixel.G;
count += 1;
}
}
Console.WriteLine("V1:{0}\tV2:{1}\t\tCount:{2}", value1, value2, count);
}
//break;
}
}
#endregion
//set image
try {
this.Invoke(new invSet(set));
} catch { }
}
}