Skip to content
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

converting image to byte array #17

Open
chaabanihoussem opened this issue Oct 14, 2023 · 2 comments
Open

converting image to byte array #17

chaabanihoussem opened this issue Oct 14, 2023 · 2 comments

Comments

@chaabanihoussem
Copy link

Hi

this is not an issue, it's a question since I couldn't find the tool

what tool was used to convert an image to this array here:

T-Dongle-S3/example/Factory /logo.h

Thanks

@lewisxhe
Copy link
Contributor

@TsKyrk
Copy link

TsKyrk commented May 9, 2024

Thank you @lewisxhe for the tool.

After many trials I found out that the process to push images on the T-dongle-S3 device is this :

  1. Use MS Paint to save your image into Bitmap 24bits format (.bmp).
    - The image must have a 2:1 ratio (width must be exactly twice the height)
  2. Open this bmp file using Image2Lcd v2.9
  3. Enter the following parameters:
  • Output file type = C array
  • Scan mode = Horizontal
  • BitsPixel = 16 bits TrueColor (the first one in the list)
  • Max Width and Height = 160 x 80 (click the arrow to apply)
  • Include head data : NOT checked
  • Scan right to left : NOT checked
  • Scan bottom to top : NOT checked
  • MSB first : checked
  • "16 bit Color" tab => R:5 G:6 B:5
  1. Save the image with .h extension (the file should have about 1600 lines of 16 bytes)
    - The file name you choose will also be the variable name in your program

Then, for example, the TFT.ino example project can be modified to add the image file to the headers and to add a new case item diplaying this new image:
case N:
tft.pushImage(0, 0, 160, 80, (uint16_t *)gImage_yourimage);
break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants