Closed zerkalica closed 5 years ago
Hello,
For now there is no function, supporting XBMP format. This can be added in future.
ssd1306_drawBitmap()
uses native ssd1306 controller format, in which each byte represents eight vertical pixels. In XBMP format each byte represents eight horizontal pixels, that's why you see the garbage.
// The image consisting of two 0x13, 0x20 bytes will look like
// ssd1306_Bitmap XBMP
// X------- XX--X---
// XX------ -X------
// -------- --------
// -------- --------
// X------- --------
// -------- --------
// -------- --------
// -------- --------
Actually, the picture you will get depends on width and height values passed to the function
Thanks. Do you know simple offline converting tools for linux? I can't find ready to use offline tool for converting bitmap image to native format (like python script)
Only this online scripts worked: http://www.majer.ch/lcd/adf_bitmap.php, http://www.rinkydinkelectronics.com/t_imageconverter_mono.php
I added ssd1306_drawXBitmap()
which supports monochrome XBMP images. Please, check.
To convert bmp picture to XBMP format I used script from https://github.com/robertgallup/bmp2hex
./bmp2hex.py -x -w 8 soba.bmp
Yes, ssd1306_drawXBitmap works. But i use canvas.drawBitmap1, may be add same canvas.drawXBitmap1?
Please, check latest commit. But I didn't test that function.
I try to create running line, but canvas shows garbage, if x position + image width is greater than canvas size (canvas.drawBitmap1 works fine here).
Example: xbm-bug.ino
canvas.drawXBitmap1(80, 0, 107, 64, s2 );
Please, check the fix
Thank you, my example works fine.
You're welcome
How to prepare image for ssd1306_drawBitmap?
I try to convert image to indexed 1bit color xbm (via gimp) and place array into draw_bitmap example. I keep example data types (uint8_t Owl [] PROGMEM). ssd1306_drawBitmap produce garbage on my OLED.
Something like u8g2.drawXBMP?
bl.xbm