-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[thermalprinter] Bitmap printing doesn't work #119
Comments
There's a limitation in the printer driver where it runs through each pixel and only prints out dark pixels and doesn't print light pixels. You may need to do additional image processing before it can work. There are some techniques to doing a halftone effect for the printer. I've included a star bitmap that you can use as a test to verify the printer is outputting something. |
Thanks alot for your quick reply! Unfortunately, neither of your suggested solutions seem to work, I'm still getting only blank lines out of the printer (it does the "printing sound" but prints nothing; text is printed anyway). This is my updated code:
|
It's possible that there's a bug in the implementation, as it's been a while since I've played with a printer, but the original code looks the same as the current implementations. Here's the original code that uses a basic handler instead of the global queuing system.
|
Ok, with this code I am able to print the star icon. When I try to print other simple icons, the output is "compressed" vertically. Printing my original bitmap is also compressed like this (and completely black). Do you have any suggestions regarding the compression? |
By compressed, do you mean that it'll omit certain rows? The black issue may be due to the internal rendering process from your bitmap to the pixels. Maybe it's due to the background? It's interesting that the code snippet above does work, as I didn't think anything should be different. |
By compressed I mean that the width of the printed image is okay, but the height is only like 1/3 of the size the printed image should have. What really confuses me is that this doesn't happen with your star image but with all images and icons I tried. |
Hi i am working on the printing image with ESC * command i have tried everything to get the image printer in 48mm paper. but when it prints if the mode is 33 so it gives the too much between the andother piece of the image with garbage values. this is the code which i am reusing to print the image. public void printImage(Bitmap image) {
Please guide me i am stuck in solving this. i want to print the entire image with ESC * command how can i achieve this. i have googled a lot on this but didnt found any link working for me. |
Today I wanted to print an image (bitmap) captured with the Pi's camera on the thermal printer. The bitmap is captured properly, but the printer only prints "empty" lines instead of the picture. This is my code snippet:
I also tried printing other bitmaps created from drawable resources but nothing changed. The logcat doesn't show any errors or warnings at all.
The printer is initialized in the onCreate() method of the activity. The printer itself is on firmware v2.69, printing texts works without issues.
Has anyone experienced similar issues? #
The text was updated successfully, but these errors were encountered: