Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- namespace GenerarCodigoQR
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- qrCodeImgControl1.Text = textBox1.Text;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- //OBTENER LA IMAGEN DEL CODIGO QR GENERADO
- Image img = (Image)qrCodeImgControl1.Image.Clone();
- //GUARDAR LA IMAGEN A UN ARCHIVO .jpg
- SaveFileDialog sv = new SaveFileDialog();
- sv.AddExtension = true;
- sv.Filter = "Image JPG (*.jpg)|*.jpg";
- sv.ShowDialog();
- if (!string.IsNullOrEmpty(sv.FileName))
- {
- img.Save(sv.FileName);
- }
- img.Dispose();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment