mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Added "Monitor test" to tools menu
This commit is contained in:
parent
8783779d2f
commit
a259dc866d
6 changed files with 832 additions and 4 deletions
392
HelpersLib/Forms/MonitorTestForm.Designer.cs
generated
Normal file
392
HelpersLib/Forms/MonitorTestForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,392 @@
|
|||
namespace HelpersLib
|
||||
{
|
||||
partial class MonitorTestForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pSettings = new System.Windows.Forms.Panel();
|
||||
this.cbGradient = new System.Windows.Forms.ComboBox();
|
||||
this.rbGradient = new System.Windows.Forms.RadioButton();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.lblShapeSize = new System.Windows.Forms.Label();
|
||||
this.lblShapeSizeValue = new System.Windows.Forms.Label();
|
||||
this.tbShapeSize = new System.Windows.Forms.TrackBar();
|
||||
this.btnColorDialog = new System.Windows.Forms.Button();
|
||||
this.cbShapes = new System.Windows.Forms.ComboBox();
|
||||
this.rbShapes = new System.Windows.Forms.RadioButton();
|
||||
this.lblBlue = new System.Windows.Forms.Label();
|
||||
this.lblBlueValue = new System.Windows.Forms.Label();
|
||||
this.tbBlue = new System.Windows.Forms.TrackBar();
|
||||
this.lblGreen = new System.Windows.Forms.Label();
|
||||
this.lblGreenValue = new System.Windows.Forms.Label();
|
||||
this.tbGreen = new System.Windows.Forms.TrackBar();
|
||||
this.lblRed = new System.Windows.Forms.Label();
|
||||
this.lblRedValue = new System.Windows.Forms.Label();
|
||||
this.tbRed = new System.Windows.Forms.TrackBar();
|
||||
this.rbRedGreenBlue = new System.Windows.Forms.RadioButton();
|
||||
this.lblBlackWhiteValue = new System.Windows.Forms.Label();
|
||||
this.tbBlackWhite = new System.Windows.Forms.TrackBar();
|
||||
this.rbBlackWhite = new System.Windows.Forms.RadioButton();
|
||||
this.lblTip = new System.Windows.Forms.Label();
|
||||
this.pSettings.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbShapeSize)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbBlue)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbGreen)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbRed)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbBlackWhite)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pSettings
|
||||
//
|
||||
this.pSettings.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||
this.pSettings.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.pSettings.Controls.Add(this.lblTip);
|
||||
this.pSettings.Controls.Add(this.cbGradient);
|
||||
this.pSettings.Controls.Add(this.rbGradient);
|
||||
this.pSettings.Controls.Add(this.btnClose);
|
||||
this.pSettings.Controls.Add(this.lblShapeSize);
|
||||
this.pSettings.Controls.Add(this.lblShapeSizeValue);
|
||||
this.pSettings.Controls.Add(this.tbShapeSize);
|
||||
this.pSettings.Controls.Add(this.btnColorDialog);
|
||||
this.pSettings.Controls.Add(this.cbShapes);
|
||||
this.pSettings.Controls.Add(this.rbShapes);
|
||||
this.pSettings.Controls.Add(this.lblBlue);
|
||||
this.pSettings.Controls.Add(this.lblBlueValue);
|
||||
this.pSettings.Controls.Add(this.tbBlue);
|
||||
this.pSettings.Controls.Add(this.lblGreen);
|
||||
this.pSettings.Controls.Add(this.lblGreenValue);
|
||||
this.pSettings.Controls.Add(this.tbGreen);
|
||||
this.pSettings.Controls.Add(this.lblRed);
|
||||
this.pSettings.Controls.Add(this.lblRedValue);
|
||||
this.pSettings.Controls.Add(this.tbRed);
|
||||
this.pSettings.Controls.Add(this.rbRedGreenBlue);
|
||||
this.pSettings.Controls.Add(this.lblBlackWhiteValue);
|
||||
this.pSettings.Controls.Add(this.tbBlackWhite);
|
||||
this.pSettings.Controls.Add(this.rbBlackWhite);
|
||||
this.pSettings.Location = new System.Drawing.Point(24, 24);
|
||||
this.pSettings.Name = "pSettings";
|
||||
this.pSettings.Size = new System.Drawing.Size(320, 368);
|
||||
this.pSettings.TabIndex = 0;
|
||||
//
|
||||
// cbGradient
|
||||
//
|
||||
this.cbGradient.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbGradient.FormattingEnabled = true;
|
||||
this.cbGradient.Location = new System.Drawing.Point(88, 222);
|
||||
this.cbGradient.Name = "cbGradient";
|
||||
this.cbGradient.Size = new System.Drawing.Size(216, 21);
|
||||
this.cbGradient.TabIndex = 22;
|
||||
this.cbGradient.SelectedIndexChanged += new System.EventHandler(this.cbGradient_SelectedIndexChanged);
|
||||
//
|
||||
// rbGradient
|
||||
//
|
||||
this.rbGradient.AutoSize = true;
|
||||
this.rbGradient.Location = new System.Drawing.Point(16, 224);
|
||||
this.rbGradient.Name = "rbGradient";
|
||||
this.rbGradient.Size = new System.Drawing.Size(68, 17);
|
||||
this.rbGradient.TabIndex = 21;
|
||||
this.rbGradient.Text = "Gradient:";
|
||||
this.rbGradient.UseVisualStyleBackColor = true;
|
||||
this.rbGradient.CheckedChanged += new System.EventHandler(this.rbGradient_CheckedChanged);
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Location = new System.Drawing.Point(208, 8);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(96, 23);
|
||||
this.btnClose.TabIndex = 20;
|
||||
this.btnClose.Text = "Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// lblShapeSize
|
||||
//
|
||||
this.lblShapeSize.AutoSize = true;
|
||||
this.lblShapeSize.Location = new System.Drawing.Point(16, 302);
|
||||
this.lblShapeSize.Name = "lblShapeSize";
|
||||
this.lblShapeSize.Size = new System.Drawing.Size(30, 13);
|
||||
this.lblShapeSize.TabIndex = 19;
|
||||
this.lblShapeSize.Text = "Size:";
|
||||
//
|
||||
// lblShapeSizeValue
|
||||
//
|
||||
this.lblShapeSizeValue.AutoSize = true;
|
||||
this.lblShapeSizeValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.lblShapeSizeValue.Location = new System.Drawing.Point(280, 300);
|
||||
this.lblShapeSizeValue.Name = "lblShapeSizeValue";
|
||||
this.lblShapeSizeValue.Size = new System.Drawing.Size(15, 16);
|
||||
this.lblShapeSizeValue.TabIndex = 18;
|
||||
this.lblShapeSizeValue.Text = "1";
|
||||
//
|
||||
// tbShapeSize
|
||||
//
|
||||
this.tbShapeSize.AutoSize = false;
|
||||
this.tbShapeSize.Location = new System.Drawing.Point(40, 296);
|
||||
this.tbShapeSize.Maximum = 100;
|
||||
this.tbShapeSize.Minimum = 1;
|
||||
this.tbShapeSize.Name = "tbShapeSize";
|
||||
this.tbShapeSize.Size = new System.Drawing.Size(232, 24);
|
||||
this.tbShapeSize.TabIndex = 17;
|
||||
this.tbShapeSize.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.tbShapeSize.Value = 1;
|
||||
this.tbShapeSize.ValueChanged += new System.EventHandler(this.tbShapeSize_ValueChanged);
|
||||
//
|
||||
// btnColorDialog
|
||||
//
|
||||
this.btnColorDialog.Location = new System.Drawing.Point(208, 88);
|
||||
this.btnColorDialog.Name = "btnColorDialog";
|
||||
this.btnColorDialog.Size = new System.Drawing.Size(96, 23);
|
||||
this.btnColorDialog.TabIndex = 16;
|
||||
this.btnColorDialog.Text = "Color dialog...";
|
||||
this.btnColorDialog.UseVisualStyleBackColor = true;
|
||||
this.btnColorDialog.Click += new System.EventHandler(this.btnColorDialog_Click);
|
||||
//
|
||||
// cbShapes
|
||||
//
|
||||
this.cbShapes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbShapes.FormattingEnabled = true;
|
||||
this.cbShapes.Items.AddRange(new object[] {
|
||||
"Checker",
|
||||
"Horizontal lines",
|
||||
"Vertical lines"});
|
||||
this.cbShapes.Location = new System.Drawing.Point(88, 262);
|
||||
this.cbShapes.Name = "cbShapes";
|
||||
this.cbShapes.Size = new System.Drawing.Size(216, 21);
|
||||
this.cbShapes.TabIndex = 15;
|
||||
this.cbShapes.SelectedIndexChanged += new System.EventHandler(this.cbShapes_SelectedIndexChanged);
|
||||
//
|
||||
// rbShapes
|
||||
//
|
||||
this.rbShapes.AutoSize = true;
|
||||
this.rbShapes.Location = new System.Drawing.Point(16, 264);
|
||||
this.rbShapes.Name = "rbShapes";
|
||||
this.rbShapes.Size = new System.Drawing.Size(59, 17);
|
||||
this.rbShapes.TabIndex = 14;
|
||||
this.rbShapes.Text = "Shape:";
|
||||
this.rbShapes.UseVisualStyleBackColor = true;
|
||||
this.rbShapes.CheckedChanged += new System.EventHandler(this.rbShapes_CheckedChanged);
|
||||
//
|
||||
// lblBlue
|
||||
//
|
||||
this.lblBlue.AutoSize = true;
|
||||
this.lblBlue.Location = new System.Drawing.Point(16, 190);
|
||||
this.lblBlue.Name = "lblBlue";
|
||||
this.lblBlue.Size = new System.Drawing.Size(17, 13);
|
||||
this.lblBlue.TabIndex = 13;
|
||||
this.lblBlue.Text = "B:";
|
||||
//
|
||||
// lblBlueValue
|
||||
//
|
||||
this.lblBlueValue.AutoSize = true;
|
||||
this.lblBlueValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.lblBlueValue.Location = new System.Drawing.Point(280, 188);
|
||||
this.lblBlueValue.Name = "lblBlueValue";
|
||||
this.lblBlueValue.Size = new System.Drawing.Size(15, 16);
|
||||
this.lblBlueValue.TabIndex = 12;
|
||||
this.lblBlueValue.Text = "0";
|
||||
//
|
||||
// tbBlue
|
||||
//
|
||||
this.tbBlue.AutoSize = false;
|
||||
this.tbBlue.Location = new System.Drawing.Point(32, 184);
|
||||
this.tbBlue.Maximum = 255;
|
||||
this.tbBlue.Name = "tbBlue";
|
||||
this.tbBlue.Size = new System.Drawing.Size(240, 24);
|
||||
this.tbBlue.TabIndex = 11;
|
||||
this.tbBlue.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.tbBlue.ValueChanged += new System.EventHandler(this.tbRedGreenBlue_ValueChanged);
|
||||
//
|
||||
// lblGreen
|
||||
//
|
||||
this.lblGreen.AutoSize = true;
|
||||
this.lblGreen.Location = new System.Drawing.Point(16, 158);
|
||||
this.lblGreen.Name = "lblGreen";
|
||||
this.lblGreen.Size = new System.Drawing.Size(18, 13);
|
||||
this.lblGreen.TabIndex = 10;
|
||||
this.lblGreen.Text = "G:";
|
||||
//
|
||||
// lblGreenValue
|
||||
//
|
||||
this.lblGreenValue.AutoSize = true;
|
||||
this.lblGreenValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.lblGreenValue.Location = new System.Drawing.Point(280, 156);
|
||||
this.lblGreenValue.Name = "lblGreenValue";
|
||||
this.lblGreenValue.Size = new System.Drawing.Size(15, 16);
|
||||
this.lblGreenValue.TabIndex = 9;
|
||||
this.lblGreenValue.Text = "0";
|
||||
//
|
||||
// tbGreen
|
||||
//
|
||||
this.tbGreen.AutoSize = false;
|
||||
this.tbGreen.Location = new System.Drawing.Point(32, 152);
|
||||
this.tbGreen.Maximum = 255;
|
||||
this.tbGreen.Name = "tbGreen";
|
||||
this.tbGreen.Size = new System.Drawing.Size(240, 24);
|
||||
this.tbGreen.TabIndex = 8;
|
||||
this.tbGreen.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.tbGreen.ValueChanged += new System.EventHandler(this.tbRedGreenBlue_ValueChanged);
|
||||
//
|
||||
// lblRed
|
||||
//
|
||||
this.lblRed.AutoSize = true;
|
||||
this.lblRed.Location = new System.Drawing.Point(16, 126);
|
||||
this.lblRed.Name = "lblRed";
|
||||
this.lblRed.Size = new System.Drawing.Size(18, 13);
|
||||
this.lblRed.TabIndex = 7;
|
||||
this.lblRed.Text = "R:";
|
||||
//
|
||||
// lblRedValue
|
||||
//
|
||||
this.lblRedValue.AutoSize = true;
|
||||
this.lblRedValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.lblRedValue.Location = new System.Drawing.Point(280, 124);
|
||||
this.lblRedValue.Name = "lblRedValue";
|
||||
this.lblRedValue.Size = new System.Drawing.Size(15, 16);
|
||||
this.lblRedValue.TabIndex = 6;
|
||||
this.lblRedValue.Text = "0";
|
||||
//
|
||||
// tbRed
|
||||
//
|
||||
this.tbRed.AutoSize = false;
|
||||
this.tbRed.Location = new System.Drawing.Point(32, 120);
|
||||
this.tbRed.Maximum = 255;
|
||||
this.tbRed.Name = "tbRed";
|
||||
this.tbRed.Size = new System.Drawing.Size(240, 24);
|
||||
this.tbRed.TabIndex = 5;
|
||||
this.tbRed.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.tbRed.ValueChanged += new System.EventHandler(this.tbRedGreenBlue_ValueChanged);
|
||||
//
|
||||
// rbRedGreenBlue
|
||||
//
|
||||
this.rbRedGreenBlue.AutoSize = true;
|
||||
this.rbRedGreenBlue.Location = new System.Drawing.Point(16, 88);
|
||||
this.rbRedGreenBlue.Name = "rbRedGreenBlue";
|
||||
this.rbRedGreenBlue.Size = new System.Drawing.Size(110, 17);
|
||||
this.rbRedGreenBlue.TabIndex = 4;
|
||||
this.rbRedGreenBlue.Text = "Red, Green, Blue:";
|
||||
this.rbRedGreenBlue.UseVisualStyleBackColor = true;
|
||||
this.rbRedGreenBlue.CheckedChanged += new System.EventHandler(this.rbRedGreenBlue_CheckedChanged);
|
||||
//
|
||||
// lblBlackWhiteValue
|
||||
//
|
||||
this.lblBlackWhiteValue.AutoSize = true;
|
||||
this.lblBlackWhiteValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.lblBlackWhiteValue.Location = new System.Drawing.Point(280, 52);
|
||||
this.lblBlackWhiteValue.Name = "lblBlackWhiteValue";
|
||||
this.lblBlackWhiteValue.Size = new System.Drawing.Size(15, 16);
|
||||
this.lblBlackWhiteValue.TabIndex = 3;
|
||||
this.lblBlackWhiteValue.Text = "0";
|
||||
//
|
||||
// tbBlackWhite
|
||||
//
|
||||
this.tbBlackWhite.AutoSize = false;
|
||||
this.tbBlackWhite.Location = new System.Drawing.Point(8, 48);
|
||||
this.tbBlackWhite.Maximum = 255;
|
||||
this.tbBlackWhite.Name = "tbBlackWhite";
|
||||
this.tbBlackWhite.Size = new System.Drawing.Size(264, 24);
|
||||
this.tbBlackWhite.TabIndex = 2;
|
||||
this.tbBlackWhite.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.tbBlackWhite.ValueChanged += new System.EventHandler(this.tbBlackWhite_ValueChanged);
|
||||
//
|
||||
// rbBlackWhite
|
||||
//
|
||||
this.rbBlackWhite.AutoSize = true;
|
||||
this.rbBlackWhite.Location = new System.Drawing.Point(16, 16);
|
||||
this.rbBlackWhite.Name = "rbBlackWhite";
|
||||
this.rbBlackWhite.Size = new System.Drawing.Size(89, 17);
|
||||
this.rbBlackWhite.TabIndex = 1;
|
||||
this.rbBlackWhite.Text = "Black, White:";
|
||||
this.rbBlackWhite.UseVisualStyleBackColor = true;
|
||||
this.rbBlackWhite.CheckedChanged += new System.EventHandler(this.rbBlackWhite_CheckedChanged);
|
||||
//
|
||||
// lblTip
|
||||
//
|
||||
this.lblTip.AutoSize = true;
|
||||
this.lblTip.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.lblTip.Location = new System.Drawing.Point(16, 336);
|
||||
this.lblTip.Name = "lblTip";
|
||||
this.lblTip.Size = new System.Drawing.Size(279, 16);
|
||||
this.lblTip.TabIndex = 23;
|
||||
this.lblTip.Text = "You can click outside for hide/show this panel.";
|
||||
//
|
||||
// MonitorTestForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Gray;
|
||||
this.ClientSize = new System.Drawing.Size(600, 500);
|
||||
this.Controls.Add(this.pSettings);
|
||||
this.Cursor = System.Windows.Forms.Cursors.Default;
|
||||
this.DoubleBuffered = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.KeyPreview = true;
|
||||
this.Name = "MonitorTestForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "MonitorTest";
|
||||
this.TopMost = true;
|
||||
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyUp);
|
||||
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MainForm_MouseDown);
|
||||
this.pSettings.ResumeLayout(false);
|
||||
this.pSettings.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbShapeSize)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbBlue)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbGreen)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbRed)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tbBlackWhite)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel pSettings;
|
||||
private System.Windows.Forms.Label lblBlackWhiteValue;
|
||||
private System.Windows.Forms.TrackBar tbBlackWhite;
|
||||
private System.Windows.Forms.RadioButton rbBlackWhite;
|
||||
private System.Windows.Forms.Label lblBlue;
|
||||
private System.Windows.Forms.Label lblBlueValue;
|
||||
private System.Windows.Forms.TrackBar tbBlue;
|
||||
private System.Windows.Forms.Label lblGreen;
|
||||
private System.Windows.Forms.Label lblGreenValue;
|
||||
private System.Windows.Forms.TrackBar tbGreen;
|
||||
private System.Windows.Forms.Label lblRed;
|
||||
private System.Windows.Forms.Label lblRedValue;
|
||||
private System.Windows.Forms.TrackBar tbRed;
|
||||
private System.Windows.Forms.RadioButton rbRedGreenBlue;
|
||||
private System.Windows.Forms.ComboBox cbShapes;
|
||||
private System.Windows.Forms.RadioButton rbShapes;
|
||||
private System.Windows.Forms.Button btnColorDialog;
|
||||
private System.Windows.Forms.Label lblShapeSize;
|
||||
private System.Windows.Forms.Label lblShapeSizeValue;
|
||||
private System.Windows.Forms.TrackBar tbShapeSize;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.ComboBox cbGradient;
|
||||
private System.Windows.Forms.RadioButton rbGradient;
|
||||
private System.Windows.Forms.Label lblTip;
|
||||
|
||||
}
|
||||
}
|
272
HelpersLib/Forms/MonitorTestForm.cs
Normal file
272
HelpersLib/Forms/MonitorTestForm.cs
Normal file
|
@ -0,0 +1,272 @@
|
|||
#region License Information (GPL v3)
|
||||
|
||||
/*
|
||||
ShareX - A program that allows you to take screenshots and share any file type
|
||||
Copyright (C) 2008-2013 ShareX Developers
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HelpersLib
|
||||
{
|
||||
public partial class MonitorTestForm : Form
|
||||
{
|
||||
public MonitorTestForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Rectangle screenBounds = CaptureHelpers.GetScreenBounds();
|
||||
Location = screenBounds.Location;
|
||||
Size = screenBounds.Size;
|
||||
|
||||
rbBlackWhite.Checked = true;
|
||||
tbBlackWhite.Value = 100;
|
||||
tbRed.Value = 255;
|
||||
cbGradient.Items.AddRange(Enum.GetNames(typeof(LinearGradientMode)));
|
||||
cbGradient.SelectedIndex = 1;
|
||||
cbShapes.SelectedIndex = 0;
|
||||
tbShapeSize.Value = 3;
|
||||
}
|
||||
|
||||
private void SetBackColor()
|
||||
{
|
||||
SetBackColor(Color.White);
|
||||
}
|
||||
|
||||
private void SetBackColor(Color color)
|
||||
{
|
||||
if (BackgroundImage != null)
|
||||
{
|
||||
Image temp = BackgroundImage;
|
||||
BackgroundImage = null;
|
||||
temp.Dispose();
|
||||
}
|
||||
|
||||
BackColor = color;
|
||||
}
|
||||
|
||||
private void DrawBlackWhite(int value)
|
||||
{
|
||||
Color color = Color.FromArgb(value, value, value);
|
||||
SetBackColor(color);
|
||||
}
|
||||
|
||||
private void DrawRedGreenBlue(int red, int green, int blue)
|
||||
{
|
||||
Color color = Color.FromArgb(red, green, blue);
|
||||
SetBackColor(color);
|
||||
}
|
||||
|
||||
private Bitmap DrawGradient(Color fromColor, Color toColor, LinearGradientMode gradientMode)
|
||||
{
|
||||
Bitmap bmp = new Bitmap(Width, Height);
|
||||
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
|
||||
|
||||
using (Graphics g = Graphics.FromImage(bmp))
|
||||
using (LinearGradientBrush brush = new LinearGradientBrush(rect, fromColor, toColor, gradientMode))
|
||||
{
|
||||
g.FillRectangle(brush, rect);
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
private Bitmap DrawHorizontalLine(int size, Color color)
|
||||
{
|
||||
Bitmap bmp = new Bitmap(1, size * 2);
|
||||
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
bmp.SetPixel(0, i, color);
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
private Bitmap DrawVerticalLine(int size, Color color)
|
||||
{
|
||||
Bitmap bmp = new Bitmap(size * 2, 1);
|
||||
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
bmp.SetPixel(i, 0, color);
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
private Bitmap DrawChecker(int size, Color color)
|
||||
{
|
||||
Bitmap bmp = new Bitmap(size * 2, size * 2);
|
||||
|
||||
using (Graphics g = Graphics.FromImage(bmp))
|
||||
using (Brush brush = new SolidBrush(color))
|
||||
{
|
||||
g.FillRectangle(brush, new Rectangle(0, 0, size, size));
|
||||
g.FillRectangle(brush, new Rectangle(size, size, size, size));
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
private void DrawBlackWhite()
|
||||
{
|
||||
if (rbBlackWhite.Checked)
|
||||
{
|
||||
DrawBlackWhite(tbBlackWhite.Value);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawRedGreenBlue()
|
||||
{
|
||||
if (rbRedGreenBlue.Checked)
|
||||
{
|
||||
DrawRedGreenBlue(tbRed.Value, tbGreen.Value, tbBlue.Value);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawGradient()
|
||||
{
|
||||
if (rbGradient.Checked)
|
||||
{
|
||||
SetBackColor();
|
||||
|
||||
LinearGradientMode gradientMode = (LinearGradientMode)cbGradient.SelectedIndex;
|
||||
BackgroundImage = DrawGradient(Color.DarkGray, Color.Black, gradientMode);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSelectedShape()
|
||||
{
|
||||
if (rbShapes.Checked)
|
||||
{
|
||||
SetBackColor();
|
||||
|
||||
int shapeSize = Math.Max(tbShapeSize.Value, 1);
|
||||
|
||||
switch (cbShapes.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
BackgroundImage = DrawChecker(shapeSize, Color.Black);
|
||||
break;
|
||||
case 1:
|
||||
BackgroundImage = DrawHorizontalLine(shapeSize, Color.Black);
|
||||
break;
|
||||
case 2:
|
||||
BackgroundImage = DrawVerticalLine(shapeSize, Color.Black);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Form events
|
||||
|
||||
private void MainForm_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void MainForm_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
bool visible = !pSettings.Visible;
|
||||
if (visible) pSettings.Location = e.Location;
|
||||
pSettings.Visible = visible;
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void rbBlackWhite_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DrawBlackWhite();
|
||||
}
|
||||
|
||||
private void tbBlackWhite_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblBlackWhiteValue.Text = tbBlackWhite.Value.ToString();
|
||||
DrawBlackWhite();
|
||||
}
|
||||
|
||||
private void rbRedGreenBlue_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DrawRedGreenBlue();
|
||||
}
|
||||
|
||||
private void btnColorDialog_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (DialogColor dialogColor = new DialogColor(Color.FromArgb(tbRed.Value, tbGreen.Value, tbBlue.Value)))
|
||||
{
|
||||
if (dialogColor.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Color color = dialogColor.NewColor;
|
||||
tbRed.Value = color.R;
|
||||
tbGreen.Value = color.G;
|
||||
tbBlue.Value = color.B;
|
||||
DrawRedGreenBlue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void tbRedGreenBlue_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblRedValue.Text = tbRed.Value.ToString();
|
||||
lblGreenValue.Text = tbGreen.Value.ToString();
|
||||
lblBlueValue.Text = tbBlue.Value.ToString();
|
||||
DrawRedGreenBlue();
|
||||
}
|
||||
|
||||
private void rbGradient_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DrawGradient();
|
||||
}
|
||||
|
||||
private void cbGradient_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
DrawGradient();
|
||||
}
|
||||
|
||||
private void rbShapes_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DrawSelectedShape();
|
||||
}
|
||||
|
||||
private void cbShapes_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
DrawSelectedShape();
|
||||
}
|
||||
|
||||
private void tbShapeSize_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblShapeSizeValue.Text = tbShapeSize.Value.ToString();
|
||||
DrawSelectedShape();
|
||||
}
|
||||
|
||||
#endregion Form events
|
||||
}
|
||||
}
|
120
HelpersLib/Forms/MonitorTestForm.resx
Normal file
120
HelpersLib/Forms/MonitorTestForm.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -87,6 +87,12 @@
|
|||
<Compile Include="ConvolutionMatrix.cs" />
|
||||
<Compile Include="ConvolutionMatrixManager.cs" />
|
||||
<Compile Include="FontSafe.cs" />
|
||||
<Compile Include="Forms\MonitorTestForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\MonitorTestForm.Designer.cs">
|
||||
<DependentUpon>MonitorTestForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\SSLBypassHelper.cs" />
|
||||
<Compile Include="UITypeEditors\EnumDescriptionConverter.cs" />
|
||||
<Compile Include="UITypeEditors\MyColorConverter.cs" />
|
||||
|
@ -310,6 +316,9 @@
|
|||
<EmbeddedResource Include="Forms\InputBox.resx">
|
||||
<DependentUpon>InputBox.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\MonitorTestForm.resx">
|
||||
<DependentUpon>MonitorTestForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UpdateChecker\UpdaterForm.resx">
|
||||
<DependentUpon>UpdaterForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
28
ShareX/Forms/MainForm.Designer.cs
generated
28
ShareX/Forms/MainForm.Designer.cs
generated
|
@ -92,6 +92,7 @@ private void InitializeComponent()
|
|||
this.tsmiHashCheck = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsmiIndexFolder = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsmiImageEffects = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsmiMonitorTest = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsbScreenshotsFolder = new System.Windows.Forms.ToolStripButton();
|
||||
this.tsbHistory = new System.Windows.Forms.ToolStripButton();
|
||||
this.tsbImageHistory = new System.Windows.Forms.ToolStripButton();
|
||||
|
@ -208,6 +209,7 @@ private void InitializeComponent()
|
|||
this.tssTray3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsmiTrayExit = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ssToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsmiTrayMonitorTest = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsMain.SuspendLayout();
|
||||
this.scMain.Panel1.SuspendLayout();
|
||||
this.scMain.Panel2.SuspendLayout();
|
||||
|
@ -533,7 +535,8 @@ private void InitializeComponent()
|
|||
this.tsmiScreenColorPicker,
|
||||
this.tsmiHashCheck,
|
||||
this.tsmiIndexFolder,
|
||||
this.tsmiImageEffects});
|
||||
this.tsmiImageEffects,
|
||||
this.tsmiMonitorTest});
|
||||
this.tsddbTools.Image = global::ShareX.Properties.Resources.toolbox;
|
||||
this.tsddbTools.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.tsddbTools.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
|
@ -573,6 +576,14 @@ private void InitializeComponent()
|
|||
this.tsmiImageEffects.Text = "Image effects...";
|
||||
this.tsmiImageEffects.Click += new System.EventHandler(this.tsmiImageEffects_Click);
|
||||
//
|
||||
// tsmiMonitorTest
|
||||
//
|
||||
this.tsmiMonitorTest.Image = global::ShareX.Properties.Resources.monitor;
|
||||
this.tsmiMonitorTest.Name = "tsmiMonitorTest";
|
||||
this.tsmiMonitorTest.Size = new System.Drawing.Size(183, 22);
|
||||
this.tsmiMonitorTest.Text = "Monitor test...";
|
||||
this.tsmiMonitorTest.Click += new System.EventHandler(this.tsmiMonitorTest_Click);
|
||||
//
|
||||
// tsbScreenshotsFolder
|
||||
//
|
||||
this.tsbScreenshotsFolder.Image = global::ShareX.Properties.Resources.folder_open_image;
|
||||
|
@ -1191,7 +1202,7 @@ private void InitializeComponent()
|
|||
this.tssTray3,
|
||||
this.tsmiTrayExit});
|
||||
this.cmsTray.Name = "cmsTray";
|
||||
this.cmsTray.Size = new System.Drawing.Size(189, 396);
|
||||
this.cmsTray.Size = new System.Drawing.Size(189, 418);
|
||||
//
|
||||
// tsmiTrayClipboardUpload
|
||||
//
|
||||
|
@ -1453,7 +1464,8 @@ private void InitializeComponent()
|
|||
this.tsmiTrayScreenColorPicker,
|
||||
this.tsmiTrayHashCheck,
|
||||
this.tsmiTrayIndexFolder,
|
||||
this.tsmiTrayImageEffects});
|
||||
this.tsmiTrayImageEffects,
|
||||
this.tsmiTrayMonitorTest});
|
||||
this.tsmiTrayTools.Image = global::ShareX.Properties.Resources.toolbox;
|
||||
this.tsmiTrayTools.Name = "tsmiTrayTools";
|
||||
this.tsmiTrayTools.Size = new System.Drawing.Size(188, 22);
|
||||
|
@ -1550,6 +1562,14 @@ private void InitializeComponent()
|
|||
this.ssToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.ssToolStripMenuItem.Text = "ss";
|
||||
//
|
||||
// tsmiTrayMonitorTest
|
||||
//
|
||||
this.tsmiTrayMonitorTest.Image = global::ShareX.Properties.Resources.monitor;
|
||||
this.tsmiTrayMonitorTest.Name = "tsmiTrayMonitorTest";
|
||||
this.tsmiTrayMonitorTest.Size = new System.Drawing.Size(183, 22);
|
||||
this.tsmiTrayMonitorTest.Text = "Monitor test...";
|
||||
this.tsmiTrayMonitorTest.Click += new System.EventHandler(this.tsmiMonitorTest_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
|
@ -1735,5 +1755,7 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.ToolStripMenuItem tsmiTrayImageEffects;
|
||||
private System.Windows.Forms.ToolStripButton tsmiAbout;
|
||||
private System.Windows.Forms.ToolStripButton tsmiDonate;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsmiMonitorTest;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsmiTrayMonitorTest;
|
||||
}
|
||||
}
|
|
@ -575,6 +575,14 @@ private void OpenImageEffects()
|
|||
}
|
||||
}
|
||||
|
||||
private void OpenMonitorTest()
|
||||
{
|
||||
using (MonitorTestForm monitorTestForm = new MonitorTestForm())
|
||||
{
|
||||
monitorTestForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
#region Form events
|
||||
|
||||
protected override void SetVisibleCore(bool value)
|
||||
|
@ -768,6 +776,11 @@ private void tsmiImageEffects_Click(object sender, EventArgs e)
|
|||
OpenImageEffects();
|
||||
}
|
||||
|
||||
private void tsmiMonitorTest_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenMonitorTest();
|
||||
}
|
||||
|
||||
private void tsbScreenshotsFolder_Click(object sender, EventArgs e)
|
||||
{
|
||||
Helpers.OpenFolder(Program.ScreenshotsPath);
|
||||
|
|
Loading…
Reference in a new issue