-
Is it possible to add a String below the visible image that is generated? |
Beta Was this translation helpful? Give feedback.
Answered by
codebude
Aug 5, 2021
Replies: 2 comments
-
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... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
codebude
-
Thank you so much for the reply.
Much appreciated.
…On Thu, Aug 5, 2021 at 8:25 AM Raffael Herrmann ***@***.***> wrote:
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 aboveBitmap 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...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#314 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3KJBLT3CHAS4XE5XPMN2TT3IVELANCNFSM5BRMQB5A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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