Results 1 to 7 of 7

Thread: How can i add personal image jpeg to qr code c#

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    37

    How can i add personal image jpeg to qr code c#

    Problem

    How to encoded personal image and generate qr code for personal image with data related ?

    Details

    I work in visual studio 2015 using c# windows form application .

    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 as

    user name and address and card no .

    Until now i generated qr code with text data as address textbox and user name and card no But No Personal Image .

    Meaning i need to generate qr code include customer name and address and card no

    And Image all done remaining 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 :
    Code:
    //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);  
    
    
                    }  
    
                }  
            }  
    
        }  
    }

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: How can i add personal image jpeg to qr code c#

    Follow the CodeBank link in my signature and check out my thread on Saving Images To Databases. That thread demonstrates how to save an Image object to a byte array via a MemoryStream. Once you have a byte array, you can call Convert.ToBase64String to get a string that you can then feed to your QRCodeEncoder.

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    37

    Re: How can i add personal image jpeg to qr code c#

    Can you give me link you remember above
    i dont know how to access

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    37

    Re: How can i add personal image jpeg to qr code c#

    I asked in more forums it tell me that cannot encoded image . all you can do when encode image is to convert to link
    and when scan also .
    but before two days i some customer request from me to make qr code encode and decode personal image
    and he see to me when scan or decoded qr code his personal image
    meaning it is possible to make that
    so that what idea can do that

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: How can i add personal image jpeg to qr code c#

    QR*codes are not very big so it seems reasonable that you wouldn't be able to save as much data as is required by*an image. If you still want to give it a try then you can do as I said but you may be disappointed. As for finding that*thread I mentioned, I'm here to help people learn how to program. If you can't use the web then you have some*work to do on your own first. You're just as capable*as me of clicking a link and reading a web page.

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    37

    Re: How can i add personal image jpeg to qr code c#

    Can you please if possible
    see this link video
    https://www.youtube.com/watch?v=7Ou-DFMgh1c
    if qr code not have all data so that how he made here in this video
    can you give me idea if you know

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: How can i add personal image jpeg to qr code c#

    I've told you what to do. Now you need to do it. I don't need to watch any videos.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width