public ImgurUpload(TrayWindow tw) { // point1 = p1; // point2 = p2; trayWindow = tw; // Take_Screenshot(); }
public Capture(TrayWindow tw) { InitializeComponent(); this.SuspendLayout(); imgurUpload = new ImgurUpload(tw); // Set the WindowState to normal and remove all decoration from the form. // Set the size of the form to the resolution of each monitor combined. // Ex: Two 1080p monitors will create a form of size 3840 x 1080. this.WindowState = FormWindowState.Normal; this.FormBorderStyle = FormBorderStyle.None; this.ClientSize = new System.Drawing.Size(SystemInformation.VirtualScreen.Width, SystemInformation.VirtualScreen.Height); // Set both the TransparencyKey and the BackColor to the same color, making the form fully transparent but still clickable. // Set the opacity to allow a semi-transparent rectangle to be drawn. this.TransparencyKey = Color.LavenderBlush; this.BackColor = Color.LavenderBlush; this.Opacity = 0.20f; // Double buffering helps prevent flickering when the rectangle is redrawn. this.DoubleBuffered = true; // Disable the taskbar icon when the form is open. this.ShowInTaskbar = false; // Create form events. this.Load += new System.EventHandler(this.Capture_Load); this.Paint += new System.Windows.Forms.PaintEventHandler(this.Capture_Paint); this.Deactivate += new System.EventHandler(this.Capture_Deactivate); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Capture_MouseDown); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Capture_MouseUp); this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Capture_Moved); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Capture_KeyPressed); this.ResumeLayout(false); clicked = false; }