using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MessagingToolkit.QRCode.Codec;
using MessagingToolkit.QRCode.Codec.Data;
using DataMatrix.net;
using OnBarcode.Barcode.WinForms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string url = textBox1.Text;
DmtxImageEncoder encoder = new DmtxImageEncoder();
Bitmap qrcode = encoder.EncodeImage(url);
pictureBox1.Image = qrcode as Image;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
SaveFileDialog s = new SaveFileDialog();
s.Filter = "PNG|*.png|JPEG|*.jpg|BMP|*.bmp|GIF|*.gif";
if (s.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
pictureBox1.Image.Save(s.FileName);
}
}
private void button3_Click(object sender, EventArgs e)
{
OpenFileDialog o = new OpenFileDialog();
if (o.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
pictureBox1.ImageLocation = o.FileName;
}
}
private void button4_Click(object sender, EventArgs e)
{
DmtxImageDecoder decoder = new DmtxImageDecoder();
//MessageBox.Show(decoder.decode(new QRCodeBitmapImage(pictureBox1.Image as Bitmap)));
}
}
}