public TakeForm(Image screenImage) { InitializeComponent(); #if DEBUG TopMost = false; #endif SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); action = TakeScreenAction.Selection; srcImage = screenImage; var winEnumDelegate = new Helper.EnumDelegate((h, p) => { if (!Helper.IsWindowVisible(h)) { return(true); } windowsRects.Add(Helper.GetWindowRect(h)); return(true); }); Helper.EnumDesktopWindows(IntPtr.Zero, winEnumDelegate, IntPtr.Zero); Load += (s, e) => Helper.SetForegroundWindow(Handle); }
public TakeForm(Image screenImage) { InitializeComponent(); #if DEBUG TopMost = false; #endif SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); action = TakeScreenAction.Selection; srcImage = screenImage; var winEnumDelegate = new Helper.EnumDelegate((h, p) => { if (!Helper.IsWindowVisible(h)) return true; windowsRects.Add(Helper.GetWindowRect(h)); return true; }); Helper.EnumDesktopWindows(IntPtr.Zero, winEnumDelegate, IntPtr.Zero); Load += (s, e) => Helper.SetForegroundWindow(Handle); }
protected override void OnMouseDown(MouseEventArgs e) { if (e.Button != MouseButtons.Left) { return; } isMouseDown = true; action = TakeScreenAction.Selection; selection = Rectangle.Empty; selectionStart = new Point(e.X, e.Y); Invalidate(); base.OnMouseDown(e); }
protected override void OnMouseDown(MouseEventArgs e) { if (e.Button != MouseButtons.Left) return; isMouseDown = true; action = TakeScreenAction.Selection; selection = Rectangle.Empty; selectionStart = new Point(e.X, e.Y); Invalidate(); base.OnMouseDown(e); }