Logo 
Search:

Artificial Intelligence Forum

Ask Question   UnAnswered
Home » Forum » Artificial Intelligence       RSS Feeds

Code for creating QR Code barcodes in C#

  Asked By: Peter    Date: Jan 04    Category: Artificial Intelligence    Views: 4948
  

Hi, guys. Anyone knows QR Code barcode generation in C#? I want to create some QR Code barcodes in Java. And I tried to find some source code for this. And I found this:


using System;
using System.Collections.Generic;
using System.Text;
using OnBarcode.Barcode;
using System.Drawing.Imaging;
using System.Drawing;


QRCode qrcode = new QRCode();

// Barcode data to encode
qrcode.Data = "ONBARCODE";
// QR-Code data mode
qrcode.DataMode = QRCodeDataMode.AlphaNumeric;
// QR-Code format mode
//qrcode.Version = QRCodeVersion.V10;

/*
* Barcode Image Related Settings
*/
// Unit of meature for all size related setting in the library.
qrcode.UOM = UnitOfMeasure.PIXEL;
// Bar module size (X), default is 3 pixel;
qrcode.X = 3;
// Barcode image left, right, top, bottom margins. Defaults are 0.
qrcode.LeftMargin = 0;
qrcode.RightMargin = 0;
qrcode.TopMargin = 0;
qrcode.BottomMargin = 0;
// Image resolution in dpi, default is 72 dpi.
qrcode.Resolution = 72;
// Created barcode orientation.
//4 options are: facing left, facing right, facing bottom, and facing top
qrcode.Rotate = Rotate.Rotate0;

// Generate QR-Code and encode barcode to gif format
qrcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif;
qrcode.drawBarcode("C:\\qrcode.gif");

/*
You can also call other drawing methods to generate barcodes

public void drawBarcode(Graphics graphics);

public void drawBarcode(string filename);

public Bitmap drawBarcode();

public void drawBarcode(Stream stream);

*/
(www.onbarcode.com/csharp/qr-code-generator.html)
But it did not work? Why is that? Anyone know about this? Thank you inadvance!!!!

Share: 

 

14 Answers Found

 
Answer #1    Answered By: Gorge STF     Answered On: Jun 18

hi all,

refer this technical article in C#corner
www.c-sharpcorner.com/.../

 
Didn't find what you were looking for? Find more on Code for creating QR Code barcodes in C# Or get search suggestion and latest updates.




Tagged: