ThermalDotNet
ThermalDotNet copied to clipboard
How to print QRCode?
I saw that on your website there was a receipt with QRCode there. That's what I need! If it is through the PrintImage function that you have in your project it does not seem to be working correctly because it only prints random characters ... If you can help me I would be very grateful! I need to put a QRCode in Image on the Receipt.
The PrintImage method only prints Bitmap objects and they must be 384 pixels wide.
To print a QRCode you must generate and Bitmap object first.
There's plenty of .NET libraries to do this. For my project I used this library : https://www.nuget.org/packages/MessagingToolkit.QRCode/
Can you help me? I have an image in my desktyop called qrcode.bmp, so i can use that file to the function TestImage() right? I think it's not 384 pixels, so i need to transform it to 384 right?
Can i do something like that? Since i'ts a bmp file...
printer.WriteLine("Test image:");
Bitmap img = new Bitmap("../../../qrcode.bmp");
printer.LineFeed();
printer.PrintImage(img);
printer.LineFeed();
printer.WriteLine("Image OK");
This should work, also you should run your code before posting it. ;)
How to resize an image : https://stackoverflow.com/questions/1922040/how-to-resize-an-image-c-sharp
Alright thank you! Just one more thing, my english is a bit bad and i dont know the meaning of "wide" can the image be 384x384 pixels?
Because, i tried to print the image that comes with the solutin the mono-logo and it just prints random characters.. What should i do?
Can you please help?