Exemple #1
0
        public new void Show()
        {
            var reference = screen.ReferenceRectangle();

            AreaForm               = CreateOverlayForm();
            AreaForm.BackColor     = Color.Fuchsia;
            AreaForm.DesktopBounds = new Rectangle(new Point(reference.X + sample.SearchArea.X, reference.Y + sample.SearchArea.Y), sample.SearchArea.Size);
            AreaForm.TopMost       = true;
            AreaForm.Show();

            if (FoundAt != Point.Empty)
            {
                var pos = sample.AbsolutePosition(FoundAt);
                if (sample is Button)
                {
                    var area = ((Button)sample).ClickArea(pos);
                    ClickAreaForm               = CreateOverlayForm();
                    ClickAreaForm.BackColor     = Color.Red;
                    ClickAreaForm.DesktopBounds = new Rectangle(new Point(area.X + reference.X, area.Y + reference.Y), area.Size);
                    ClickAreaForm.Show();
                }
                else
                {
                    ClickPoint               = CreateOverlayForm();
                    ClickPoint.BackColor     = Color.Blue;
                    ClickPoint.DesktopBounds = new Rectangle(new Point(sample.SearchArea.X + reference.X, sample.SearchArea.Y + reference.Y), sample.SearchArea.Size);
                    ClickPoint.Show();
                }
            }
            base.Show();
        }