Re: Print barcode in C#
Good. Here is another useful code for generating QR Code barcode in C# (http://www.onbarcode.com/csharp/qr-code-generator.html):
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);
*/
You can also find source code for generating QR Code barcode in Java(http://www.onbarcode.com/products/java_barcode/barcodes/qrcode.html).
Subject
Written By
Posted
December 12, 2012 09:13PM
December 13, 2012 08:22AM
December 16, 2012 07:45PM
December 19, 2012 05:05AM
Re: Print barcode in C#
February 01, 2013 12:55AM
November 27, 2013 08:14PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.