TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to Generate QR Code in C#
Harieswaran D
Dec 19, 2014
8.6
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
In this blog you will learn how to Generate QR Code in C#.
Qr generater.rar
Generate QR Code in C#
I am using a third party dll named as Zxing. It’s Originally developed in java platform.
We can specify the Height and Width of generated QR image.
I have attached the dll for you to download.
We can also generate other codes such as MAXICODE,UCP and so on.
private
void
Form1_Load(
object
sender, EventArgse)
{
Bitmap img = GenerateQR(50, 50,
"Becauset he DataContext class is the entry point to the LINQ-to-SQL data model"
);
img.Save(@
"D:\TESTING FROM APPS c#/hari.bmp"
);
// Give the path to save the generated bitmap image
}
public
Bitmap GenerateQR(
int
width,
int
height, stringtext)
{
var bw =
new
ZXing.BarcodeWriter();
var encOptions =
new
Xing.Common.EncodingOptions() { Width= width, Height = height, Margin = 0 };
bw.Options= encOptions;
bw.Format =ZXing.BarcodeFormat.QR_CODE;
var result =
new
Bitmap(bw.Write(text));
return
result;
}
Next Recommended Reading
Convert Code From C# To VB.NET And From VB.NET To C#