Пример #1
0
        public void waitCompleteLocate()
        {
            var p         = findImage("tr-corner");
            var x         = 5;
            var y         = 5;
            var len       = x * y;
            var prev_data = new string[len];

            while (true)
            {
                var current_data = new string[len];
                var is_dirty     = false;
                for (int i = 0; i < x; i++)
                {
                    for (int j = 0; j < y; j++)
                    {
                        var index = i * y + j;
                        current_data[index] = dm.GetColor(p.X - (x + 1) * 10, p.Y + (y + 1) * 10);
                        if (current_data[index] != prev_data[index])
                        {
                            is_dirty = true;
                        }
                    }
                }
                if (!is_dirty)
                {
                    break;
                }
                prev_data = current_data;
                Thread.Sleep(500);
            }
        }
Пример #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            var p = dm.FindPic(0, 0, 2000, 2000, "resources/arrow1.bmp");

            if (p.X > -1)
            {
                var str = "";
                for (int i = 0; i < 5; i++)
                {
                    var x1 = p.X - 184;
                    var y1 = p.Y + 46 + i * 68;
                    str += dm.GetColor(x1, y1) == "114b51" ? "0" : "1";
                    //str += dm.GetColor(x1, y1)+ " ";
                }
                AddLog("检测结果 " + str);
            }
            else
            {
                AddLog("未检测到结果");
            }
        }