private void button3_Click(object sender, EventArgs e) { xMine = Convert.ToInt32(textBox4.Text); yMine = Convert.ToInt32(textBox3.Text); int xadd = 0, yadd = 0; boxesColorValueArray = new int[xMine, yMine]; string colorsString = ""; double[] ccc = ssc.BoxDim(pntr1, pntr2, xMine, yMine); //Cursor.Position = new Point((pntr1.X), (pntr1.Y)); //DoMouseClick(); for (int yctr = 0; yctr < yMine; yctr++) { for (int cntr = 0; cntr < xMine; cntr++) { xadd = Convert.ToInt32((ccc[0] / 2) + ccc[0] * cntr); yadd = Convert.ToInt32((ccc[1] / 2) + ccc[1] * yctr); Cursor.Position = new Point((pntr1.X + xadd), (pntr1.Y + yadd)); Thread.Sleep(20); //boxesColorValueArray[cntr, yctr] = (int)GetPixelColor(Cursor.Position.X, Cursor.Position.Y).R; boxesColorValueArray[cntr, yctr] = (int)GetPixelColor(pntr1.X + xadd, pntr1.Y + yadd).R; colorsString += boxesColorValueArray[cntr, yctr].ToString() + ", "; Thread.Sleep(10); DoRightClick(); } } colorsString += "Total boxes:" + boxesColorValueArray.Length.ToString(); MessageBox.Show(colorsString); }
private void button3_Click(object sender, EventArgs e) { xMine = Convert.ToInt32(textBox4.Text); yMine = Convert.ToInt32(textBox3.Text); int xadd = 0, yadd = 0; double[] ccc = ssc.BoxDim(pntr1, pntr2, xMine, yMine); for (int yctr = 0; yctr < yMine; yctr++) { for (int cntr = 0; cntr < xMine; cntr++) { xadd = Convert.ToInt32((ccc[0] / 2) + ccc[0] * cntr); yadd = Convert.ToInt32((ccc[1] / 2) + ccc[1] * yctr); Cursor.Position = new Point((pntr1.X + xadd), (pntr1.Y + yadd)); DoRightClick(); Thread.Sleep(20); } } }