ahmed salah

ahmed salah

  • NA
  • 530
  • 148.7k

How to print qr code in windows form c#

Dec 26 2016 3:01 PM
I work in visual studio 2015 windows form application and i need to print qr code by using c#
How can i print qr code generation ?
I generated using the following code : 
 
  1. if (textBox1.Text =="")  
  2.           {  
  3.                
  4.               MessageBox.Show("Please Enter Value ","Error");  
  5.               textBox1.Focus();  
  6.           }  
  7.           else  
  8.           {   
  9.           using (SaveFileDialog sv = new SaveFileDialog() { Filter = "JPEG|.jpg", ValidateNames = true })  
  10.           {  
  11.               if (sv.ShowDialog() == DialogResult.OK)  
  12.               {  
  13.                   MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();  
  14.                   encoder.QRCodeScale = 8;  
  15.                   string encoding="UserName : " + textBox1.Text + "\r\n" + "CardNo : " + textBox2.Text + "\r\n" + "Address:" + textBox3.Text + "\r\n"+textBox5.Text;  
  16.                   Bitmap bmp = encoder.Encode(encoding);  
  17.                   pictureBox1.Image = bmp;  
  18.                   bmp.Save(sv.FileName, ImageFormat.Jpeg);  
  19.               }  
  20.   
  21.           }  
  22.           }  
  23.   
  24.       }  
 Im sorry i posted this in asp.net forum by wrong .

Answers (4)