Exemple #1
0
        void timer_Tick(object sender, EventArgs e)
        {
            if (counter == 50)
            {
                Point     p    = Picker.GetMousePoint();
                ColorCode code = new ColorCode(Picker.GetPixelColor((int)p.X, (int)p.Y));
                tipsWin.ShowTips(code, p);
                counter = -1;
                //System.Console.WriteLine("------------"+counter);
                return;
            }
            //System.Console.WriteLine(counter);
            Point mouseCurPoint = Picker.GetMousePoint();

            if (Math.Abs(mousePoint.X - mouseCurPoint.X) < 5 && Math.Abs(mousePoint.Y - mouseCurPoint.Y) < 5)
            {
                if (counter > -1)
                {
                    counter++;
                }
            }
            else
            {
                counter    = 0;
                mousePoint = mouseCurPoint;
            }
        }