Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I worked in c# windows form visual studio 2015 and i need to print qr code using c#

windows form I already generated it but cannot print .

Can any one tell me how to print qr code generated as following :


C#
if (textBox1.Text =="")
          {

              MessageBox.Show("Please Enter Value ","Error");
              textBox1.Focus();
          }
          else
          {
          using (SaveFileDialog sv = new SaveFileDialog() { Filter = "JPEG|.jpg", ValidateNames = true })
          {
              if (sv.ShowDialog() == DialogResult.OK)
              {
                  MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();
                  encoder.QRCodeScale = 8;
                  string encoding="UserName : " + textBox1.Text + "\r\n" + "CardNo : " + textBox2.Text + "\r\n" + "Address:" + textBox3.Text + "\r\n"+textBox5.Text;
                  Bitmap bmp = encoder.Encode(encoding);
                  pictureBox1.Image = bmp;
                  bmp.Save(sv.FileName, ImageFormat.Jpeg);
              }

          }
          }

      }


What I have tried:

how can i print qr code in c# windows form
Posted
Updated 26-Dec-16 21:01pm
Comments
Maciej Los 27-Dec-16 2:58am    
What have you tried?

1 solution

Printing in Windows Form is pretty easy. Check this:
Windows Forms Print Support[^]
How to: Print a Windows Form[^]

Try! And come back here when you get stuck.
 
Share this answer
 
Comments
CPallini 27-Dec-16 3:10am    
5.
Maciej Los 27-Dec-16 3:12am    
Thank you, Carlo.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900