Exemplo n.º 1
0
        /// <summary>Paints the overlay</summary>
        protected void PaintHighlight(Graphics gfx, Rectangle win_rect, Rectangle highlight_rect)
        {
            // Paint the blue layer
            highlight_rect.Inflate(2, 2);
            using (gfx.SaveState())
            {
                gfx.SetClip(highlight_rect, CombineMode.Exclude);
                using (var b = Gdi.CreateRadialGradientBrush(highlight_rect.Centre(), 500, 500, Color.FromArgb(0xA0, Color.DarkBlue), Color.FromArgb(0x10, Color.LightSkyBlue)))
                    gfx.FillRectangle(b, win_rect);
            }

            // Draw a border
            using (var pen0 = new Pen(Color.DarkBlue, 3f))
                using (var pen1 = new Pen(Color.LightSkyBlue, 5f))
                {
                    gfx.DrawRectangle(pen0, highlight_rect);
                    highlight_rect.Inflate(5, 5);
                    gfx.DrawRectangle(pen1, highlight_rect);
                }
        }