---
title: "How can i add personal image jpeg to qr code c#"  
description: "How can i add personal image jpeg to qr code c#"  
author: "Abeer Shlby"  
published: 2016-12-26  
updated: 2016-12-26  
canonical: https://www.mindstick.com/forum/34225/how-can-i-add-personal-image-jpeg-to-qr-code-c-sharp  
category: "c#"  
tags: ["c#", ".net"]  
reading_time: 3 minutes  

---

# How can i add personal image jpeg to qr code c#

**How to encoded [personal image](https://www.mindstick.com/forum/34227/how-to-generate-qr-code-for-my-personal-image) and generate [qr code](https://www.mindstick.com/blog/304218/the-rise-of-qr-code-phishing-attacks) for personal image ?** I work in [visual studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) 2015 using c# [windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) [form application](https://www.mindstick.com/interview/23108/how-to-create-form-application-using-dot-net) . I need to encode personal image to qr code . Meaning when i select personal image then click to generate it will generate qr code with personal image and [related data](https://www.mindstick.com/interview/22990/what-is-lazy-eager-and-explicit-loading-of-related-data-in-entity-frameworks) as [user name](https://www.mindstick.com/interview/33836/how-to-check-current-user-name-of-database-in-sql-server) and address and card no . until now i generated qr code with [text data](https://answers.mindstick.com/qa/112298/how-do-i-implement-sentiment-analysis-in-text-data) as address textbox and user name and card no but personal image How to encoded personal image to be as encoded qr with related data ? Meaning i need to generate qr code include [customer](https://www.mindstick.com/articles/325839/how-to-improve-your-business-level-of-customer-service) name and address and cardno and image I do all data but cannot do image so that How to encoded personal image and generate qr code for personal image ?

code i made until now to all data without image

\

```
namespace MatrixBarcode
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
//button1 to encoded all data i do all text but remaing image How to make
        private void button1_Click(object sender, EventArgs e)
        {
            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" + textBox3.Text;
                    Bitmap bmp = encoder.Encode(encoding);
                    pictureBox1.Image = bmp;
                    bmp.Save(sv.FileName, ImageFormat.Jpeg);
                }

            }
            }

        }
//button2 for selecting personal image
        private void button2_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog sv1 = new OpenFileDialog() { Filter = "JPEG|*.jpg", ValidateNames = true,Multiselect=false })
            {
                if (sv1.ShowDialog() == DialogResult.OK)
                {
                    pictureBox2.Image = Image.FromFile(sv1.FileName);


                }

            }
        }

    }
}  
```

\


---

Original Source: https://www.mindstick.com/forum/34225/how-can-i-add-personal-image-jpeg-to-qr-code-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
