Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6338943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:32:53+00:00 2026-05-24T19:32:53+00:00

I am writing an application which is going to generate qr codes. Most of

  • 0

I am writing an application which is going to generate qr codes.

Most of the programming logic is implemented.

The next step in the process would be to generate the qr code image.

The most simple qr code is based on a 21×21 grid in which I have to make a tile (1×1) either black / white.

For more info: http://www.thonky.com/qr-code-tutorial/part-3-mask-pattern/

What would be the best approach for this.

I need to:

  1. Show a preview of the code in the application

  2. Give the user the option to save the qr code as an image (.jpg I think).

I.e. how to make an image which can be build like above and how to save it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:32:56+00:00Added an answer on May 24, 2026 at 7:32 pm

    In order to create the QR code image, you will need to generate a bitmap in your application. Sample code to do this is:

    'Create a new QR bitmap image  
    Dim bmp As New Bitmap(21, 21)
    
    'Get the graphics object to manipulate the bitmap
    Dim gr As Graphics = Graphics.FromImage(bmp)
    
    'Set the background of the bitmap to white
    gr.FillRectangle(Brushes.White, 0, 0, 21, 21)
    
    'Draw position detection patterns
    'Top Left
    gr.DrawRectangle(Pens.Black, 0, 0, 6, 6)
    gr.FillRectangle(Brushes.Black, 2, 2, 3, 3)
    
    'Top Right
    gr.DrawRectangle(Pens.Black, 14, 0, 6, 6)
    gr.FillRectangle(Brushes.Black, 2, 16, 3, 3)
    
    'Bottom Left
    gr.DrawRectangle(Pens.Black, 0, 14, 6, 6)
    gr.FillRectangle(Brushes.Black, 16, 2, 3, 3)
    
    
    '*** Drawing pixels is done off the bitmap object, not the graphics object
    
    'Arbitrary black pixel
    bmp.SetPixel(8, 14, Color.Black)
    
    'Top timing pattern
    bmp.SetPixel(8, 6, Color.Black)
    bmp.SetPixel(10, 6, Color.Black)
    bmp.SetPixel(12, 6, Color.Black)
    
    'Left timing pattern
    bmp.SetPixel(6, 8, Color.Black)
    bmp.SetPixel(6, 10, Color.Black)
    bmp.SetPixel(6, 12, Color.Black)
    
    'Add code here to set the rest of the pixels as needed
    

    In order to display the image to the end user you can use a PictureBox control:

    Me.PictureBox1.Image = bmp
    

    And finally, in order to save the bitmap you can call the save function on it:

    bmp.Save("C:\QR.jpg", Drawing.Imaging.ImageFormat.Jpeg)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an application which is going to allows users to change the
I am in the process of writing an application in which I use the
I’m currently on the task of writing a c# application, which is going sit
I am writing a slide-show like application for android phone which I am going
I'm writing an application which reads large arrays of floats and performs some simple
I am writing an application which blocks on input from two istreams . Reading
I'm writing an application which has to be configurable to connect to Oracle, SQL
I've been writing an application which will need to expand environment strings in a
I'm writing an application which is quite graphically heavy and therefore I'm trying to
I'm writing an application which plays multiple sounds concurrently, each sound needs to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.