Added upload image button to QR code context menu

This commit is contained in:
Jaex 2018-02-26 10:11:22 +03:00
parent 749d52e484
commit d19aa3146e
3 changed files with 52 additions and 5 deletions

View file

@ -43,6 +43,8 @@ private void InitializeComponent()
this.txtDecodeResult = new System.Windows.Forms.TextBox();
this.lblDecodeResult = new System.Windows.Forms.Label();
this.btnDecodeFromScreen = new System.Windows.Forms.Button();
this.tsmiUpload = new System.Windows.Forms.ToolStripMenuItem();
this.tss1 = new System.Windows.Forms.ToolStripSeparator();
this.cmsQR.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbQRCode)).BeginInit();
this.tcMain.SuspendLayout();
@ -55,6 +57,8 @@ private void InitializeComponent()
this.cmsQR.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiCopy,
this.tsmiSaveAs,
this.tsmiUpload,
this.tss1,
this.tsmiDecode});
this.cmsQR.Name = "cmsQR";
this.cmsQR.ShowImageMargin = false;
@ -142,6 +146,17 @@ private void InitializeComponent()
this.btnDecodeFromScreen.UseVisualStyleBackColor = true;
this.btnDecodeFromScreen.Click += new System.EventHandler(this.btnDecodeFromScreen_Click);
//
// tsmiUpload
//
this.tsmiUpload.Name = "tsmiUpload";
resources.ApplyResources(this.tsmiUpload, "tsmiUpload");
this.tsmiUpload.Click += new System.EventHandler(this.tsmiUpload_Click);
//
// tss1
//
this.tss1.Name = "tss1";
resources.ApplyResources(this.tss1, "tss1");
//
// QRCodeForm
//
resources.ApplyResources(this, "$this");
@ -177,5 +192,7 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblDecodeResult;
private System.Windows.Forms.Button btnDecodeFromFile;
private System.Windows.Forms.ToolStripMenuItem tsmiDecode;
private System.Windows.Forms.ToolStripMenuItem tsmiUpload;
private System.Windows.Forms.ToolStripSeparator tss1;
}
}

View file

@ -168,6 +168,15 @@ private void tsmiSaveAs_Click(object sender, EventArgs e)
}
}
private void tsmiUpload_Click(object sender, EventArgs e)
{
if (pbQRCode.Image != null)
{
Image img = (Image)pbQRCode.Image.Clone();
UploadManager.UploadImage(img);
}
}
private void tsmiDecode_Click(object sender, EventArgs e)
{
if (pbQRCode.Image != null)

View file

@ -122,25 +122,34 @@
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tsmiCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>151, 22</value>
<value>180, 22</value>
</data>
<data name="tsmiCopy.Text" xml:space="preserve">
<value>Copy to clipboard</value>
<value>Copy image to clipboard</value>
</data>
<data name="tsmiSaveAs.Size" type="System.Drawing.Size, System.Drawing">
<value>151, 22</value>
<value>180, 22</value>
</data>
<data name="tsmiSaveAs.Text" xml:space="preserve">
<value>Save as image file...</value>
</data>
<data name="tsmiUpload.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="tsmiUpload.Text" xml:space="preserve">
<value>Upload image</value>
</data>
<data name="tss1.Size" type="System.Drawing.Size, System.Drawing">
<value>177, 6</value>
</data>
<data name="tsmiDecode.Size" type="System.Drawing.Size, System.Drawing">
<value>151, 22</value>
<value>180, 22</value>
</data>
<data name="tsmiDecode.Text" xml:space="preserve">
<value>Decode</value>
</data>
<data name="cmsQR.Size" type="System.Drawing.Size, System.Drawing">
<value>152, 70</value>
<value>181, 120</value>
</data>
<data name="cmsQR.Text" xml:space="preserve">
<value>QR</value>
@ -423,6 +432,18 @@
<data name="&gt;&gt;tsmiDecode.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsmiUpload.Name" xml:space="preserve">
<value>tsmiUpload</value>
</data>
<data name="&gt;&gt;tsmiUpload.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tss1.Name" xml:space="preserve">
<value>tss1</value>
</data>
<data name="&gt;&gt;tss1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>QRCodeForm</value>
</data>