├── Backup ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── zxingGUI.csproj ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── bin └── Debug │ ├── zxing.dll │ ├── zxing.pdb │ ├── zxingGUI.exe │ ├── zxingGUI.pdb │ └── zxingGUI.vshost.exe ├── obj └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── GenerateResource-ResGen.read.1.tlog │ ├── GenerateResource-ResGen.write.1.tlog │ ├── ResolveAssemblyReference.cache │ ├── TempPE │ └── Properties.Resources.Designer.cs.dll │ ├── zxingGUI.Form1.resources │ ├── zxingGUI.Properties.Resources.resources │ ├── zxingGUI.csproj.FileListAbsolute.txt │ ├── zxingGUI.csproj.GenerateResource.Cache │ ├── zxingGUI.exe │ └── zxingGUI.pdb ├── zxingGUI.csproj ├── zxingGUI.sln └── zxingGUI.suo /Backup/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace zxingGUI 2 | { 3 | partial class Form1 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.button1 = new System.Windows.Forms.Button(); 32 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); 33 | this.button2 = new System.Windows.Forms.Button(); 34 | this.SuspendLayout(); 35 | // 36 | // button1 37 | // 38 | this.button1.Location = new System.Drawing.Point(23, 64); 39 | this.button1.Name = "button1"; 40 | this.button1.Size = new System.Drawing.Size(75, 23); 41 | this.button1.TabIndex = 0; 42 | this.button1.Text = "button1"; 43 | this.button1.UseVisualStyleBackColor = true; 44 | this.button1.Click += new System.EventHandler(this.button1_Click); 45 | // 46 | // openFileDialog1 47 | // 48 | this.openFileDialog1.FileName = "openFileDialog1"; 49 | // 50 | // button2 51 | // 52 | this.button2.Location = new System.Drawing.Point(330, 149); 53 | this.button2.Name = "button2"; 54 | this.button2.Size = new System.Drawing.Size(75, 23); 55 | this.button2.TabIndex = 1; 56 | this.button2.Text = "button2"; 57 | this.button2.UseVisualStyleBackColor = true; 58 | this.button2.Click += new System.EventHandler(this.button2_Click); 59 | // 60 | // Form1 61 | // 62 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 63 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 64 | this.ClientSize = new System.Drawing.Size(524, 443); 65 | this.Controls.Add(this.button2); 66 | this.Controls.Add(this.button1); 67 | this.Name = "Form1"; 68 | this.Text = "Form1"; 69 | this.Load += new System.EventHandler(this.Form1_Load); 70 | this.ResumeLayout(false); 71 | 72 | } 73 | 74 | #endregion 75 | 76 | private System.Windows.Forms.Button button1; 77 | private System.Windows.Forms.OpenFileDialog openFileDialog1; 78 | private System.Windows.Forms.Button button2; 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /Backup/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using com.google.zxing; 5 | using COMMON = com.google.zxing.common; 6 | namespace zxingGUI 7 | { 8 | public partial class Form1 : Form 9 | { 10 | public Form1() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void Form1_Load(object sender, EventArgs e) 16 | { 17 | 18 | } 19 | 20 | private void button1_Click(object sender, EventArgs e) 21 | { 22 | if (this.openFileDialog1.ShowDialog() != DialogResult.OK) 23 | { 24 | return; 25 | } 26 | 27 | Image img = Image.FromFile(this.openFileDialog1.FileName); 28 | Bitmap bmap; 29 | try 30 | { 31 | bmap = new Bitmap(img); 32 | } 33 | catch (System.IO.IOException ioe) 34 | { 35 | MessageBox.Show(ioe.ToString()); 36 | return; 37 | } 38 | 39 | if (bmap == null) 40 | { 41 | MessageBox.Show("Could not decode image"); 42 | return; 43 | } 44 | 45 | LuminanceSource source = new RGBLuminanceSource(bmap, bmap.Width, bmap.Height); 46 | com.google.zxing.BinaryBitmap bitmap = new com.google.zxing.BinaryBitmap(new COMMON.HybridBinarizer(source)); 47 | Result result; 48 | try 49 | { 50 | result = new MultiFormatReader().decode(bitmap); 51 | } 52 | catch(ReaderException re) 53 | { 54 | MessageBox.Show(re.ToString()); 55 | return; 56 | } 57 | 58 | MessageBox.Show(result.Text); 59 | } 60 | 61 | private void button2_Click(object sender, EventArgs e) 62 | { 63 | SaveFileDialog sFD = new SaveFileDialog(); 64 | sFD.DefaultExt = "*.png|*.png"; 65 | sFD.AddExtension = true; 66 | 67 | try 68 | { 69 | if (sFD.ShowDialog() == DialogResult.OK) 70 | { 71 | string content = @"url:http://writeblog.csdn.net/PostEdit.aspx; name:nickwar"; 72 | COMMON.ByteMatrix byteMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, 350, 350); 73 | writeToFile(byteMatrix, System.Drawing.Imaging.ImageFormat.Png, sFD.FileName); 74 | } 75 | } 76 | catch (Exception ex) 77 | { 78 | MessageBox.Show(ex.Message); 79 | } 80 | } 81 | 82 | public static void writeToFile(COMMON.ByteMatrix matrix, System.Drawing.Imaging.ImageFormat format, string file) 83 | { 84 | System.Drawing.Imaging.EncoderParameters eps = new System.Drawing.Imaging.EncoderParameters(); 85 | eps.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality,100L); 86 | Bitmap bmap = toBitmap(matrix); 87 | bmap.Save(file,format); 88 | } 89 | 90 | public static Bitmap toBitmap(COMMON.ByteMatrix matrix) 91 | { 92 | int width = matrix.Width; 93 | int height = matrix.Height; 94 | Bitmap bmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); 95 | for (int x = 0; x < width; x++) 96 | { 97 | for (int y = 0; y < height; y++) 98 | { 99 | bmap.SetPixel(x, y, matrix.get_Renamed(x, y) != -1 ? ColorTranslator.FromHtml("0xFF000000") : ColorTranslator.FromHtml("0xFFFFFFFF")); 100 | } 101 | } 102 | 103 | return bmap; 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Backup/Form1.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /Backup/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace zxingGUI 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// 应用程序的主入口点。 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Backup/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过下列属性集 6 | // 控制。更改这些属性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("zxingGUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("zxingGUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2010")] 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("63a2bdaf-4001-4d3d-a593-20682eafad95")] 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 | -------------------------------------------------------------------------------- /Backup/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行库版本:2.0.50727.3603 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace zxingGUI.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", "2.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("zxingGUI.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 | -------------------------------------------------------------------------------- /Backup/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 | -------------------------------------------------------------------------------- /Backup/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.3603 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 zxingGUI.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.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 | -------------------------------------------------------------------------------- /Backup/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Backup/zxingGUI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.21022 7 | 2.0 8 | {13754F6D-8579-42BB-9890-509E553BA473} 9 | WinExe 10 | Properties 11 | zxingGUI 12 | zxingGUI 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 3.5 37 | 38 | 39 | 3.5 40 | 41 | 42 | 3.5 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | Form 53 | 54 | 55 | Form1.cs 56 | 57 | 58 | 59 | 60 | Form1.cs 61 | Designer 62 | 63 | 64 | ResXFileCodeGenerator 65 | Resources.Designer.cs 66 | Designer 67 | 68 | 69 | True 70 | Resources.resx 71 | 72 | 73 | SettingsSingleFileGenerator 74 | Settings.Designer.cs 75 | 76 | 77 | True 78 | Settings.settings 79 | True 80 | 81 | 82 | 83 | 84 | {6431CF13-7A7B-4602-B96A-47CDA6F0B008} 85 | zxing 86 | 87 | 88 | 89 | 96 | -------------------------------------------------------------------------------- /Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace zxingGUI 2 | { 3 | partial class Form1 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.button1 = new System.Windows.Forms.Button(); 32 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); 33 | this.button2 = new System.Windows.Forms.Button(); 34 | this.textBox1 = new System.Windows.Forms.TextBox(); 35 | this.SuspendLayout(); 36 | // 37 | // button1 38 | // 39 | this.button1.Location = new System.Drawing.Point(26, 57); 40 | this.button1.Name = "button1"; 41 | this.button1.Size = new System.Drawing.Size(75, 23); 42 | this.button1.TabIndex = 0; 43 | this.button1.Text = "识别"; 44 | this.button1.UseVisualStyleBackColor = true; 45 | this.button1.Click += new System.EventHandler(this.button1_Click); 46 | // 47 | // openFileDialog1 48 | // 49 | this.openFileDialog1.FileName = "openFileDialog1"; 50 | // 51 | // button2 52 | // 53 | this.button2.Location = new System.Drawing.Point(330, 149); 54 | this.button2.Name = "button2"; 55 | this.button2.Size = new System.Drawing.Size(75, 23); 56 | this.button2.TabIndex = 1; 57 | this.button2.Text = "生成"; 58 | this.button2.UseVisualStyleBackColor = true; 59 | this.button2.Click += new System.EventHandler(this.button2_Click); 60 | // 61 | // textBox1 62 | // 63 | this.textBox1.Location = new System.Drawing.Point(26, 151); 64 | this.textBox1.Name = "textBox1"; 65 | this.textBox1.Size = new System.Drawing.Size(298, 21); 66 | this.textBox1.TabIndex = 2; 67 | // 68 | // Form1 69 | // 70 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 71 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 72 | this.ClientSize = new System.Drawing.Size(524, 443); 73 | this.Controls.Add(this.textBox1); 74 | this.Controls.Add(this.button2); 75 | this.Controls.Add(this.button1); 76 | this.Name = "Form1"; 77 | this.Text = "Form1"; 78 | this.Load += new System.EventHandler(this.Form1_Load); 79 | this.ResumeLayout(false); 80 | this.PerformLayout(); 81 | 82 | } 83 | 84 | #endregion 85 | 86 | private System.Windows.Forms.Button button1; 87 | private System.Windows.Forms.OpenFileDialog openFileDialog1; 88 | private System.Windows.Forms.Button button2; 89 | private System.Windows.Forms.TextBox textBox1; 90 | } 91 | } 92 | 93 | -------------------------------------------------------------------------------- /Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using com.google.zxing; 5 | using COMMON = com.google.zxing.common; 6 | namespace zxingGUI 7 | { 8 | public partial class Form1 : Form 9 | { 10 | public Form1() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void Form1_Load(object sender, EventArgs e) 16 | { 17 | 18 | } 19 | 20 | private void button1_Click(object sender, EventArgs e) 21 | { 22 | if (this.openFileDialog1.ShowDialog() != DialogResult.OK) 23 | { 24 | return; 25 | } 26 | 27 | Image img = Image.FromFile(this.openFileDialog1.FileName); 28 | Bitmap bmap; 29 | try 30 | { 31 | bmap = new Bitmap(img); 32 | } 33 | catch (System.IO.IOException ioe) 34 | { 35 | MessageBox.Show(ioe.ToString()); 36 | return; 37 | } 38 | 39 | if (bmap == null) 40 | { 41 | MessageBox.Show("Could not decode image"); 42 | return; 43 | } 44 | 45 | LuminanceSource source = new RGBLuminanceSource(bmap, bmap.Width, bmap.Height); 46 | com.google.zxing.BinaryBitmap bitmap = new com.google.zxing.BinaryBitmap(new COMMON.HybridBinarizer(source)); 47 | Result result; 48 | try 49 | { 50 | result = new MultiFormatReader().decode(bitmap); 51 | } 52 | catch(ReaderException re) 53 | { 54 | MessageBox.Show(re.ToString()); 55 | return; 56 | } 57 | 58 | MessageBox.Show(result.Text); 59 | } 60 | 61 | private void button2_Click(object sender, EventArgs e) 62 | { 63 | if (string.IsNullOrEmpty(this.textBox1.Text.Trim())) 64 | { 65 | MessageBox.Show("请输入需要转换的信息!"); 66 | } 67 | 68 | string content = this.textBox1.Text; 69 | SaveFileDialog sFD = new SaveFileDialog(); 70 | sFD.DefaultExt = "*.png|*.png"; 71 | sFD.AddExtension = true; 72 | 73 | try 74 | { 75 | if (sFD.ShowDialog() == DialogResult.OK) 76 | { 77 | //string content = @"url:http://writeblog.csdn.net/PostEdit.aspx; name:nickwar"; 78 | COMMON.ByteMatrix byteMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, 350, 350); 79 | writeToFile(byteMatrix, System.Drawing.Imaging.ImageFormat.Png, sFD.FileName); 80 | } 81 | } 82 | catch (Exception ex) 83 | { 84 | MessageBox.Show(ex.Message); 85 | } 86 | } 87 | 88 | public static void writeToFile(COMMON.ByteMatrix matrix, System.Drawing.Imaging.ImageFormat format, string file) 89 | { 90 | System.Drawing.Imaging.EncoderParameters eps = new System.Drawing.Imaging.EncoderParameters(); 91 | eps.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality,100L); 92 | Bitmap bmap = toBitmap(matrix); 93 | bmap.Save(file,format); 94 | } 95 | 96 | public static Bitmap toBitmap(COMMON.ByteMatrix matrix) 97 | { 98 | int width = matrix.Width; 99 | int height = matrix.Height; 100 | Bitmap bmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); 101 | for (int x = 0; x < width; x++) 102 | { 103 | for (int y = 0; y < height; y++) 104 | { 105 | bmap.SetPixel(x, y, matrix.get_Renamed(x, y) != -1 ? ColorTranslator.FromHtml("0xFF000000") : ColorTranslator.FromHtml("0xFFFFFFFF")); 106 | } 107 | } 108 | 109 | return bmap; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Form1.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace zxingGUI 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// 应用程序的主入口点。 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过下列属性集 6 | // 控制。更改这些属性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("zxingGUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("zxingGUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2010")] 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("63a2bdaf-4001-4d3d-a593-20682eafad95")] 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 | -------------------------------------------------------------------------------- /Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.1 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace zxingGUI.Properties { 12 | using System; 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 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("zxingGUI.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.1 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace zxingGUI.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bin/Debug/zxing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/bin/Debug/zxing.dll -------------------------------------------------------------------------------- /bin/Debug/zxing.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/bin/Debug/zxing.pdb -------------------------------------------------------------------------------- /bin/Debug/zxingGUI.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/bin/Debug/zxingGUI.exe -------------------------------------------------------------------------------- /bin/Debug/zxingGUI.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/bin/Debug/zxingGUI.pdb -------------------------------------------------------------------------------- /bin/Debug/zxingGUI.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/bin/Debug/zxingGUI.vshost.exe -------------------------------------------------------------------------------- /obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /obj/Debug/GenerateResource-ResGen.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/GenerateResource-ResGen.read.1.tlog -------------------------------------------------------------------------------- /obj/Debug/GenerateResource-ResGen.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/GenerateResource-ResGen.write.1.tlog -------------------------------------------------------------------------------- /obj/Debug/ResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/ResolveAssemblyReference.cache -------------------------------------------------------------------------------- /obj/Debug/TempPE/Properties.Resources.Designer.cs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll -------------------------------------------------------------------------------- /obj/Debug/zxingGUI.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/zxingGUI.Form1.resources -------------------------------------------------------------------------------- /obj/Debug/zxingGUI.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/zxingGUI.Properties.Resources.resources -------------------------------------------------------------------------------- /obj/Debug/zxingGUI.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | E:\zxing\source\zxingGUI\obj\Debug\ResolveAssemblyReference.cache 2 | E:\zxing\source\zxingGUI\obj\Debug\zxingGUI.Form1.resources 3 | E:\zxing\source\zxingGUI\obj\Debug\zxingGUI.Properties.Resources.resources 4 | E:\zxing\source\zxingGUI\obj\Debug\zxingGUI.csproj.GenerateResource.Cache 5 | E:\zxing\source\zxingGUI\bin\Debug\zxingGUI.exe 6 | E:\zxing\source\zxingGUI\bin\Debug\zxingGUI.pdb 7 | E:\zxing\source\zxingGUI\bin\Debug\zxing.dll 8 | E:\zxing\source\zxingGUI\bin\Debug\zxing.pdb 9 | E:\zxing\source\zxingGUI\obj\Debug\zxingGUI.exe 10 | E:\zxing\source\zxingGUI\obj\Debug\zxingGUI.pdb 11 | D:\Code\zxing\source\zxingGUI\obj\Debug\zxingGUI.exe 12 | D:\Code\zxing\source\zxingGUI\obj\Debug\zxingGUI.pdb 13 | D:\Code\zxing\source\zxingGUI\bin\Debug\zxingGUI.exe 14 | D:\Code\zxing\source\zxingGUI\bin\Debug\zxingGUI.pdb 15 | D:\Code\zxing\source\zxingGUI\bin\Debug\zxing.dll 16 | D:\Code\zxing\source\zxingGUI\bin\Debug\zxing.pdb 17 | D:\Code\zxing\source\zxingGUI\obj\Debug\ResolveAssemblyReference.cache 18 | D:\Code\zxing\source\zxingGUI\obj\Debug\zxingGUI.Form1.resources 19 | D:\Code\zxing\source\zxingGUI\obj\Debug\zxingGUI.Properties.Resources.resources 20 | D:\Code\zxing\source\zxingGUI\obj\Debug\GenerateResource-ResGen.read.1.tlog 21 | D:\Code\zxing\source\zxingGUI\obj\Debug\GenerateResource-ResGen.write.1.tlog 22 | -------------------------------------------------------------------------------- /obj/Debug/zxingGUI.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/zxingGUI.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /obj/Debug/zxingGUI.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/zxingGUI.exe -------------------------------------------------------------------------------- /obj/Debug/zxingGUI.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/obj/Debug/zxingGUI.pdb -------------------------------------------------------------------------------- /zxingGUI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.21022 7 | 2.0 8 | {13754F6D-8579-42BB-9890-509E553BA473} 9 | WinExe 10 | Properties 11 | zxingGUI 12 | zxingGUI 13 | v3.5 14 | 512 15 | 16 | 17 | 18 | 19 | 3.5 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | AllRules.ruleset 30 | 31 | 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | AllRules.ruleset 39 | 40 | 41 | 42 | 43 | 3.5 44 | 45 | 46 | 3.5 47 | 48 | 49 | 3.5 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | Form 60 | 61 | 62 | Form1.cs 63 | 64 | 65 | 66 | 67 | Form1.cs 68 | Designer 69 | 70 | 71 | ResXFileCodeGenerator 72 | Resources.Designer.cs 73 | Designer 74 | 75 | 76 | True 77 | Resources.resx 78 | True 79 | 80 | 81 | SettingsSingleFileGenerator 82 | Settings.Designer.cs 83 | 84 | 85 | True 86 | Settings.settings 87 | True 88 | 89 | 90 | 91 | 92 | {6431CF13-7A7B-4602-B96A-47CDA6F0B008} 93 | zxing 94 | 95 | 96 | 97 | 104 | -------------------------------------------------------------------------------- /zxingGUI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zxingGUI", "zxingGUI.csproj", "{13754F6D-8579-42BB-9890-509E553BA473}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {13754F6D-8579-42BB-9890-509E553BA473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {13754F6D-8579-42BB-9890-509E553BA473}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {13754F6D-8579-42BB-9890-509E553BA473}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {13754F6D-8579-42BB-9890-509E553BA473}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /zxingGUI.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F-Sidney/ZXingGUI/7ef738084b24a96e0ced321346ae938e71f1d6f1/zxingGUI.suo --------------------------------------------------------------------------------