├── .gitignore
├── QRCodeForm
├── QRCodeForm.sln
├── QRCodeForm
│ ├── App.config
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ ├── MainForm.resx
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── QRCodeForm.csproj
│ └── packages.config
└── packages
│ └── QRCoder.1.3.3
│ ├── QRCoder.1.3.3.nupkg
│ └── lib
│ ├── monoandroid
│ └── QRCoder.dll
│ ├── monotouch
│ └── QRCoder.dll
│ ├── net35
│ ├── QRCoder.dll
│ └── UnityEngine.dll
│ ├── net40
│ ├── QRCoder.dll
│ └── UnityEngine.dll
│ ├── netcore
│ └── QRCoder.dll
│ ├── netstandard1.6
│ ├── QRCoder.dll
│ └── UnityEngine.dll
│ ├── netstandard2.0
│ ├── QRCoder.dll
│ └── UnityEngine.dll
│ ├── portable-net45+win8+wpa81
│ └── QRCoder.dll
│ ├── portable-net45+wpa81+wp81+wp8+uap
│ └── QRCoder.dll
│ ├── uap
│ └── QRCoder.dll
│ ├── uap10.0
│ └── QRCoder.dll
│ └── xamarinios
│ └── QRCoder.dll
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /QRCodeForm/.vs
2 | /QRCodeForm/QRCodeForm/bin
3 | /QRCodeForm/QRCodeForm/obj
4 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28010.2016
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRCodeForm", "QRCodeForm\QRCodeForm.csproj", "{A2CBE6B6-D00F-46F1-AB25-B4DE9B1AEF3E}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {A2CBE6B6-D00F-46F1-AB25-B4DE9B1AEF3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {A2CBE6B6-D00F-46F1-AB25-B4DE9B1AEF3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {A2CBE6B6-D00F-46F1-AB25-B4DE9B1AEF3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {A2CBE6B6-D00F-46F1-AB25-B4DE9B1AEF3E}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {9F69DDB1-C9CE-4EF8-AAD8-EFAD43B341F9}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/MainForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace QRCodeForm
2 | {
3 | partial class MainForm
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要修改
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.txtBoxOutput = new System.Windows.Forms.TextBox();
33 | this.btnQR = new System.Windows.Forms.Button();
34 | this.picBoxQRCode = new System.Windows.Forms.PictureBox();
35 | this.label2 = new System.Windows.Forms.Label();
36 | this.txtLogo = new System.Windows.Forms.TextBox();
37 | this.picBoxLogo = new System.Windows.Forms.PictureBox();
38 | this.label3 = new System.Windows.Forms.Label();
39 | this.groupBox1 = new System.Windows.Forms.GroupBox();
40 | this.btnLogoClear = new System.Windows.Forms.Button();
41 | this.numLogoBorderSize = new System.Windows.Forms.NumericUpDown();
42 | this.lbLogoBorderSize = new System.Windows.Forms.Label();
43 | this.numLogoSize = new System.Windows.Forms.NumericUpDown();
44 | this.lbLogoSize = new System.Windows.Forms.Label();
45 | this.plBackgroundColor = new System.Windows.Forms.Panel();
46 | this.plQrColor = new System.Windows.Forms.Panel();
47 | this.label5 = new System.Windows.Forms.Label();
48 | this.label4 = new System.Windows.Forms.Label();
49 | this.btnSearchLogo = new System.Windows.Forms.Button();
50 | this.numQRSize = new System.Windows.Forms.NumericUpDown();
51 | this.btnSavePic = new System.Windows.Forms.Button();
52 | this.colorDialog1 = new System.Windows.Forms.ColorDialog();
53 | ((System.ComponentModel.ISupportInitialize)(this.picBoxQRCode)).BeginInit();
54 | ((System.ComponentModel.ISupportInitialize)(this.picBoxLogo)).BeginInit();
55 | this.groupBox1.SuspendLayout();
56 | ((System.ComponentModel.ISupportInitialize)(this.numLogoBorderSize)).BeginInit();
57 | ((System.ComponentModel.ISupportInitialize)(this.numLogoSize)).BeginInit();
58 | ((System.ComponentModel.ISupportInitialize)(this.numQRSize)).BeginInit();
59 | this.SuspendLayout();
60 | //
61 | // label1
62 | //
63 | this.label1.AutoSize = true;
64 | this.label1.Location = new System.Drawing.Point(35, 23);
65 | this.label1.Name = "label1";
66 | this.label1.Size = new System.Drawing.Size(65, 12);
67 | this.label1.TabIndex = 0;
68 | this.label1.Text = "输出内容:";
69 | //
70 | // txtBoxOutput
71 | //
72 | this.txtBoxOutput.Location = new System.Drawing.Point(106, 20);
73 | this.txtBoxOutput.Name = "txtBoxOutput";
74 | this.txtBoxOutput.Size = new System.Drawing.Size(244, 21);
75 | this.txtBoxOutput.TabIndex = 1;
76 | this.txtBoxOutput.Text = "https://www.cnblogs.com/EminemJK/";
77 | //
78 | // btnQR
79 | //
80 | this.btnQR.Location = new System.Drawing.Point(297, 186);
81 | this.btnQR.Name = "btnQR";
82 | this.btnQR.Size = new System.Drawing.Size(60, 60);
83 | this.btnQR.TabIndex = 2;
84 | this.btnQR.Text = "生成";
85 | this.btnQR.UseVisualStyleBackColor = true;
86 | this.btnQR.Click += new System.EventHandler(this.btnQR_Click);
87 | //
88 | // picBoxQRCode
89 | //
90 | this.picBoxQRCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
91 | this.picBoxQRCode.Location = new System.Drawing.Point(387, 20);
92 | this.picBoxQRCode.Name = "picBoxQRCode";
93 | this.picBoxQRCode.Size = new System.Drawing.Size(250, 250);
94 | this.picBoxQRCode.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
95 | this.picBoxQRCode.TabIndex = 3;
96 | this.picBoxQRCode.TabStop = false;
97 | //
98 | // label2
99 | //
100 | this.label2.AutoSize = true;
101 | this.label2.Location = new System.Drawing.Point(23, 106);
102 | this.label2.Name = "label2";
103 | this.label2.Size = new System.Drawing.Size(77, 12);
104 | this.label2.TabIndex = 4;
105 | this.label2.Text = "Logo Image:";
106 | //
107 | // txtLogo
108 | //
109 | this.txtLogo.Location = new System.Drawing.Point(106, 103);
110 | this.txtLogo.Name = "txtLogo";
111 | this.txtLogo.ReadOnly = true;
112 | this.txtLogo.Size = new System.Drawing.Size(174, 21);
113 | this.txtLogo.TabIndex = 5;
114 | //
115 | // picBoxLogo
116 | //
117 | this.picBoxLogo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
118 | this.picBoxLogo.Location = new System.Drawing.Point(107, 130);
119 | this.picBoxLogo.Name = "picBoxLogo";
120 | this.picBoxLogo.Size = new System.Drawing.Size(121, 115);
121 | this.picBoxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
122 | this.picBoxLogo.TabIndex = 8;
123 | this.picBoxLogo.TabStop = false;
124 | //
125 | // label3
126 | //
127 | this.label3.AutoSize = true;
128 | this.label3.Location = new System.Drawing.Point(36, 48);
129 | this.label3.Name = "label3";
130 | this.label3.Size = new System.Drawing.Size(65, 12);
131 | this.label3.TabIndex = 9;
132 | this.label3.Text = "像素大小:";
133 | //
134 | // groupBox1
135 | //
136 | this.groupBox1.Controls.Add(this.btnLogoClear);
137 | this.groupBox1.Controls.Add(this.numLogoBorderSize);
138 | this.groupBox1.Controls.Add(this.lbLogoBorderSize);
139 | this.groupBox1.Controls.Add(this.numLogoSize);
140 | this.groupBox1.Controls.Add(this.lbLogoSize);
141 | this.groupBox1.Controls.Add(this.plBackgroundColor);
142 | this.groupBox1.Controls.Add(this.plQrColor);
143 | this.groupBox1.Controls.Add(this.label5);
144 | this.groupBox1.Controls.Add(this.label4);
145 | this.groupBox1.Controls.Add(this.btnSearchLogo);
146 | this.groupBox1.Controls.Add(this.numQRSize);
147 | this.groupBox1.Controls.Add(this.txtBoxOutput);
148 | this.groupBox1.Controls.Add(this.label3);
149 | this.groupBox1.Controls.Add(this.label1);
150 | this.groupBox1.Controls.Add(this.picBoxLogo);
151 | this.groupBox1.Controls.Add(this.btnQR);
152 | this.groupBox1.Controls.Add(this.label2);
153 | this.groupBox1.Controls.Add(this.txtLogo);
154 | this.groupBox1.Location = new System.Drawing.Point(12, 12);
155 | this.groupBox1.Name = "groupBox1";
156 | this.groupBox1.Size = new System.Drawing.Size(369, 286);
157 | this.groupBox1.TabIndex = 10;
158 | this.groupBox1.TabStop = false;
159 | this.groupBox1.Text = "生成设置";
160 | //
161 | // btnLogoClear
162 | //
163 | this.btnLogoClear.Location = new System.Drawing.Point(321, 103);
164 | this.btnLogoClear.Name = "btnLogoClear";
165 | this.btnLogoClear.Size = new System.Drawing.Size(29, 23);
166 | this.btnLogoClear.TabIndex = 21;
167 | this.btnLogoClear.Text = "×";
168 | this.btnLogoClear.UseVisualStyleBackColor = true;
169 | this.btnLogoClear.Click += new System.EventHandler(this.btnLogoClear_Click);
170 | //
171 | // numLogoBorderSize
172 | //
173 | this.numLogoBorderSize.Location = new System.Drawing.Point(306, 159);
174 | this.numLogoBorderSize.Name = "numLogoBorderSize";
175 | this.numLogoBorderSize.Size = new System.Drawing.Size(51, 21);
176 | this.numLogoBorderSize.TabIndex = 20;
177 | this.numLogoBorderSize.Value = new decimal(new int[] {
178 | 6,
179 | 0,
180 | 0,
181 | 0});
182 | //
183 | // lbLogoBorderSize
184 | //
185 | this.lbLogoBorderSize.AutoSize = true;
186 | this.lbLogoBorderSize.Location = new System.Drawing.Point(235, 161);
187 | this.lbLogoBorderSize.Name = "lbLogoBorderSize";
188 | this.lbLogoBorderSize.Size = new System.Drawing.Size(65, 12);
189 | this.lbLogoBorderSize.TabIndex = 19;
190 | this.lbLogoBorderSize.Text = "logo边框:";
191 | //
192 | // numLogoSize
193 | //
194 | this.numLogoSize.Location = new System.Drawing.Point(307, 132);
195 | this.numLogoSize.Name = "numLogoSize";
196 | this.numLogoSize.Size = new System.Drawing.Size(50, 21);
197 | this.numLogoSize.TabIndex = 18;
198 | this.numLogoSize.Value = new decimal(new int[] {
199 | 15,
200 | 0,
201 | 0,
202 | 0});
203 | //
204 | // lbLogoSize
205 | //
206 | this.lbLogoSize.AutoSize = true;
207 | this.lbLogoSize.Location = new System.Drawing.Point(236, 134);
208 | this.lbLogoSize.Name = "lbLogoSize";
209 | this.lbLogoSize.Size = new System.Drawing.Size(65, 12);
210 | this.lbLogoSize.TabIndex = 17;
211 | this.lbLogoSize.Text = "logo大小:";
212 | //
213 | // plBackgroundColor
214 | //
215 | this.plBackgroundColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
216 | this.plBackgroundColor.ForeColor = System.Drawing.Color.White;
217 | this.plBackgroundColor.Location = new System.Drawing.Point(237, 73);
218 | this.plBackgroundColor.Name = "plBackgroundColor";
219 | this.plBackgroundColor.Size = new System.Drawing.Size(59, 24);
220 | this.plBackgroundColor.TabIndex = 16;
221 | this.plBackgroundColor.Click += new System.EventHandler(this.ColorPicker_Click);
222 | //
223 | // plQrColor
224 | //
225 | this.plQrColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
226 | this.plQrColor.ForeColor = System.Drawing.Color.White;
227 | this.plQrColor.Location = new System.Drawing.Point(107, 73);
228 | this.plQrColor.Name = "plQrColor";
229 | this.plQrColor.Size = new System.Drawing.Size(59, 24);
230 | this.plQrColor.TabIndex = 15;
231 | this.plQrColor.Click += new System.EventHandler(this.ColorPicker_Click);
232 | //
233 | // label5
234 | //
235 | this.label5.AutoSize = true;
236 | this.label5.Location = new System.Drawing.Point(175, 78);
237 | this.label5.Name = "label5";
238 | this.label5.Size = new System.Drawing.Size(65, 12);
239 | this.label5.TabIndex = 14;
240 | this.label5.Text = "前背景色:";
241 | //
242 | // label4
243 | //
244 | this.label4.AutoSize = true;
245 | this.label4.Location = new System.Drawing.Point(47, 78);
246 | this.label4.Name = "label4";
247 | this.label4.Size = new System.Drawing.Size(53, 12);
248 | this.label4.TabIndex = 13;
249 | this.label4.Text = "条码色:";
250 | //
251 | // btnSearchLogo
252 | //
253 | this.btnSearchLogo.Location = new System.Drawing.Point(286, 103);
254 | this.btnSearchLogo.Name = "btnSearchLogo";
255 | this.btnSearchLogo.Size = new System.Drawing.Size(29, 23);
256 | this.btnSearchLogo.TabIndex = 12;
257 | this.btnSearchLogo.Text = "..";
258 | this.btnSearchLogo.UseVisualStyleBackColor = true;
259 | this.btnSearchLogo.Click += new System.EventHandler(this.btnSearchLogo_Click);
260 | //
261 | // numQRSize
262 | //
263 | this.numQRSize.Location = new System.Drawing.Point(107, 46);
264 | this.numQRSize.Name = "numQRSize";
265 | this.numQRSize.Size = new System.Drawing.Size(60, 21);
266 | this.numQRSize.TabIndex = 11;
267 | this.numQRSize.Value = new decimal(new int[] {
268 | 20,
269 | 0,
270 | 0,
271 | 0});
272 | //
273 | // btnSavePic
274 | //
275 | this.btnSavePic.Location = new System.Drawing.Point(549, 276);
276 | this.btnSavePic.Name = "btnSavePic";
277 | this.btnSavePic.Size = new System.Drawing.Size(88, 28);
278 | this.btnSavePic.TabIndex = 21;
279 | this.btnSavePic.Text = "另存为...";
280 | this.btnSavePic.UseVisualStyleBackColor = true;
281 | this.btnSavePic.Click += new System.EventHandler(this.btnSavePic_Click);
282 | //
283 | // MainForm
284 | //
285 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
286 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
287 | this.ClientSize = new System.Drawing.Size(665, 310);
288 | this.Controls.Add(this.btnSavePic);
289 | this.Controls.Add(this.groupBox1);
290 | this.Controls.Add(this.picBoxQRCode);
291 | this.Name = "MainForm";
292 | this.Text = "二维码生成测试";
293 | ((System.ComponentModel.ISupportInitialize)(this.picBoxQRCode)).EndInit();
294 | ((System.ComponentModel.ISupportInitialize)(this.picBoxLogo)).EndInit();
295 | this.groupBox1.ResumeLayout(false);
296 | this.groupBox1.PerformLayout();
297 | ((System.ComponentModel.ISupportInitialize)(this.numLogoBorderSize)).EndInit();
298 | ((System.ComponentModel.ISupportInitialize)(this.numLogoSize)).EndInit();
299 | ((System.ComponentModel.ISupportInitialize)(this.numQRSize)).EndInit();
300 | this.ResumeLayout(false);
301 |
302 | }
303 |
304 | #endregion
305 |
306 | private System.Windows.Forms.Label label1;
307 | private System.Windows.Forms.TextBox txtBoxOutput;
308 | private System.Windows.Forms.Button btnQR;
309 | private System.Windows.Forms.PictureBox picBoxQRCode;
310 | private System.Windows.Forms.Label label2;
311 | private System.Windows.Forms.TextBox txtLogo;
312 | private System.Windows.Forms.PictureBox picBoxLogo;
313 | private System.Windows.Forms.Label label3;
314 | private System.Windows.Forms.GroupBox groupBox1;
315 | private System.Windows.Forms.NumericUpDown numQRSize;
316 | private System.Windows.Forms.Panel plBackgroundColor;
317 | private System.Windows.Forms.Panel plQrColor;
318 | private System.Windows.Forms.Label label5;
319 | private System.Windows.Forms.Label label4;
320 | private System.Windows.Forms.Button btnSearchLogo;
321 | private System.Windows.Forms.NumericUpDown numLogoBorderSize;
322 | private System.Windows.Forms.Label lbLogoBorderSize;
323 | private System.Windows.Forms.NumericUpDown numLogoSize;
324 | private System.Windows.Forms.Label lbLogoSize;
325 | private System.Windows.Forms.Button btnSavePic;
326 | private System.Windows.Forms.ColorDialog colorDialog1;
327 | private System.Windows.Forms.Button btnLogoClear;
328 | }
329 | }
330 |
331 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/MainForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using QRCoder;
11 |
12 | namespace QRCodeForm
13 | {
14 | public partial class MainForm : Form
15 | {
16 | public MainForm()
17 | {
18 | InitializeComponent();
19 | plQrColor.BackColor = Color.Black;
20 | plBackgroundColor.BackColor = Color.White;
21 | logoSettingVisible(false);
22 | CreateQR(20, @"https://www.cnblogs.com/EminemJK/", Color.Black, Color.White);
23 | }
24 |
25 | private void CreateQR(int pixelsPerModule, string info, Color qrColor, Color qrBackgroundColor, Bitmap logo, int iconSizePercent = 15, int iconBorderWidth = 6)
26 | {
27 | QRCodeGenerator qrGenerator = new QRCodeGenerator();
28 | QRCodeData qrCodeData = qrGenerator.CreateQrCode(info, QRCodeGenerator.ECCLevel.Q);
29 | QRCode qrCode = new QRCode(qrCodeData);
30 | Bitmap qrCodeImage = qrCode.GetGraphic(pixelsPerModule, qrColor, qrBackgroundColor, logo, iconSizePercent, iconBorderWidth, true);
31 | picBoxQRCode.Image = qrCodeImage;
32 | }
33 |
34 | private void CreateQR(int pixelsPerModule, string info, Color qrColor, Color qrBackgroundColor)
35 | {
36 | QRCodeGenerator qrGenerator = new QRCodeGenerator();
37 | QRCodeData qrCodeData = qrGenerator.CreateQrCode(info, QRCodeGenerator.ECCLevel.Q);
38 | QRCode qrCode = new QRCode(qrCodeData);
39 | Bitmap qrCodeImage = qrCode.GetGraphic(pixelsPerModule, qrColor, qrBackgroundColor, true);
40 | picBoxQRCode.Image = qrCodeImage;
41 | }
42 |
43 | private void btnQR_Click(object sender, EventArgs e)
44 | {
45 | if (string.IsNullOrEmpty(txtBoxOutput.Text))
46 | {
47 | MessageBox.Show("内容可以是网址、文字等内容");
48 | return;
49 | }
50 | decimal pixelsPerModule = 20, iconSizePercent = 15, iconBorderWidth = 6;
51 | if (numQRSize.Value <= 0)
52 | {
53 | MessageBox.Show("二维码图片大小不能小于0");
54 | return;
55 | }
56 | pixelsPerModule = numQRSize.Value;
57 |
58 | if (numLogoSize.Value <= 0)
59 | {
60 | MessageBox.Show("Logo大小不能小于0");
61 | return;
62 | }
63 | iconSizePercent = numLogoSize.Value;
64 |
65 | if (numLogoBorderSize.Value < 0)
66 | {
67 | MessageBox.Show("二维码边框大小不能小于0");
68 | return;
69 | }
70 | iconBorderWidth = numLogoBorderSize.Value;
71 | Color qrColor = plQrColor.BackColor, qrBackgroundColor = plBackgroundColor.BackColor;
72 |
73 | if (!string.IsNullOrEmpty(txtLogo.Text))
74 | {
75 | CreateQR((int)pixelsPerModule, txtBoxOutput.Text, qrColor, qrBackgroundColor, (Bitmap)Bitmap.FromFile(txtLogo.Text), (int)iconSizePercent, (int)iconBorderWidth);
76 | }
77 | else
78 | {
79 | CreateQR((int)pixelsPerModule, txtBoxOutput.Text, qrColor, qrBackgroundColor);
80 | }
81 | }
82 |
83 | ///
84 | /// logo设置显示隐藏
85 | ///
86 | ///
87 | private void logoSettingVisible(bool b)
88 | {
89 | lbLogoBorderSize.Visible = lbLogoSize.Visible = numLogoSize.Visible = numLogoBorderSize.Visible = b;
90 | }
91 |
92 | ///
93 | /// 颜色拾取
94 | ///
95 | private void ColorPicker_Click(object sender, EventArgs e)
96 | {
97 | if (colorDialog1.ShowDialog() == DialogResult.OK)
98 | {
99 | var pl = sender as Panel;
100 | pl.BackColor = colorDialog1.Color;
101 | }
102 | }
103 |
104 | private void btnSearchLogo_Click(object sender, EventArgs e)
105 | {
106 | var openFileDialog = new OpenFileDialog();
107 | openFileDialog.Filter = "图片|*.jpg;*.png;*.bmp;*.gif";
108 | openFileDialog.RestoreDirectory = true;
109 | openFileDialog.FilterIndex = 1;
110 | openFileDialog.Multiselect = false;
111 | if (openFileDialog.ShowDialog() == DialogResult.OK)
112 | {
113 | txtLogo.Text = openFileDialog.FileName;
114 | picBoxLogo.Image = Bitmap.FromFile(txtLogo.Text);
115 | logoSettingVisible(true);
116 | }
117 | }
118 |
119 | private void btnLogoClear_Click(object sender, EventArgs e)
120 | {
121 | txtLogo.Text = "";
122 | picBoxLogo.Image = null;
123 | logoSettingVisible(false);
124 | }
125 |
126 | private void btnSavePic_Click(object sender, EventArgs e)
127 | {
128 | if (picBoxQRCode.Image != null)
129 | {
130 | SaveFileDialog saveFile = new SaveFileDialog();
131 | saveFile.Filter = "图片|*.jpg;*.png";
132 | if (saveFile.ShowDialog() == DialogResult.OK)
133 | {
134 | var pictureName = saveFile.FileName;
135 | Bitmap bmp = new Bitmap(picBoxQRCode.Image);
136 | bmp.Save(pictureName, picBoxQRCode.Image.RawFormat);
137 | bmp.Dispose();
138 | }
139 | }
140 | }
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/MainForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace QRCodeForm
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new MainForm());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("QRCodeForm")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("QRCodeForm")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("a2cbe6b6-d00f-46f1-ab25-b4de9b1aef3e")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
33 | // 方法是按如下所示使用“*”: :
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.42000
5 | //
6 | // 对此文件的更改可能导致不正确的行为,如果
7 | // 重新生成代码,则所做更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace QRCodeForm.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 强类型资源类,用于查找本地化字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的缓存 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("QRCodeForm.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 覆盖当前线程的 CurrentUICulture 属性
56 | /// 使用此强类型的资源类的资源查找。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace QRCodeForm.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/QRCodeForm.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {A2CBE6B6-D00F-46F1-AB25-B4DE9B1AEF3E}
8 | WinExe
9 | QRCodeForm
10 | QRCodeForm
11 | v4.5
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\QRCoder.1.3.3\lib\net40\QRCoder.dll
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | ..\packages\QRCoder.1.3.3\lib\net40\UnityEngine.dll
51 |
52 |
53 |
54 |
55 | Form
56 |
57 |
58 | MainForm.cs
59 |
60 |
61 |
62 |
63 | MainForm.cs
64 |
65 |
66 | ResXFileCodeGenerator
67 | Resources.Designer.cs
68 | Designer
69 |
70 |
71 | True
72 | Resources.resx
73 |
74 |
75 |
76 | SettingsSingleFileGenerator
77 | Settings.Designer.cs
78 |
79 |
80 | True
81 | Settings.settings
82 | True
83 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/QRCodeForm/QRCodeForm/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/QRCoder.1.3.3.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/QRCoder.1.3.3.nupkg
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/monoandroid/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/monoandroid/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/monotouch/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/monotouch/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/net35/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/net35/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/net35/UnityEngine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/net35/UnityEngine.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/net40/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/net40/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/net40/UnityEngine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/net40/UnityEngine.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/netcore/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/netcore/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard1.6/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard1.6/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard1.6/UnityEngine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard1.6/UnityEngine.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard2.0/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard2.0/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard2.0/UnityEngine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/netstandard2.0/UnityEngine.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/portable-net45+win8+wpa81/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/portable-net45+win8+wpa81/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/portable-net45+wpa81+wp81+wp8+uap/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/portable-net45+wpa81+wp81+wp8+uap/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/uap/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/uap/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/uap10.0/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/uap10.0/QRCoder.dll
--------------------------------------------------------------------------------
/QRCodeForm/packages/QRCoder.1.3.3/lib/xamarinios/QRCoder.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EminemJK/QRCodeForm/0d4f9b1b9ca1194d618f2dc0025f3671b2d7a782/QRCodeForm/packages/QRCoder.1.3.3/lib/xamarinios/QRCoder.dll
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # QRCodeForm
2 | 二维码生成器
3 | https://www.cnblogs.com/EminemJK/p/9915377.html
4 |
--------------------------------------------------------------------------------