Skip to content

String text below QR Image possible? #314

Answered by codebude
Tig2r asked this question in Q&A
Discussion options

You must be logged in to vote

The output of the standard QRCode renderer is a Bitmap. You can draw any string on this Bitmap by using the Graphics object as shown here: https://stackoverflow.com/a/6311628

//... QR code generation above
Bitmap qrCodeImage = qrCode.GetGraphic(20);
Graphics g = Graphics.FromImage(qrCodeImage);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.DrawString("yourText", new Font("Tahoma",8), Brushes.Black, new PointF(0,0));
g.Flush();
g.Save();
//Now do whatever you want to do with your Bitmap. Save to file, show it in a picturebox...

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by codebude
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants