Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Generate QR Code in C#
WhatsApp
Harieswaran D
10y
8.7
k
0
0
25
Blog
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;
}
Up Next
Convert Code From C# To VB.NET And From VB.NET To C#
Ebook Download
View all
Beginning C# Object Oriented Programming
Read by 35.6k people
Download Now!
Learn
View all
Membership not found