drawRGBBitmap?

Oleum

Well-known member
I would like to display a colour image on a 1.8' 160x128 display. The display works and is in colour. However, I don't know how to upload a colour bitmap image. The function I used throws an error. See the screenshot
 

Attachments

  • Error.jpg
    Error.jpg
    198.4 KB · Views: 31
Obviously, the drawRGBBitmap function is not implemented in ST7735_t3. As a beginner, I felt a bit overwhelmed, but I copied the functions from the Adafruit_GFX and copied them into the ST7735_t3. Now I actually get a coloured bitmap image on my small display.
Perhaps the creators of the ST7735_t3 could do the work of implementing the drawRGBBitmap function so that others can also use it.
 
You might try: tft.writeRect(x, y, w, h, image);

We also have versions of this, which instead of only supporting full RGB565 image (16 bit colors)
We support color palette outputs.
Code:
// writeRect8BPP -  write 8 bit per pixel paletted bitmap
  //          bitmap data in array at pixels, one byte per
  //pixel
  //          color palette data in array at palette
  void writeRect8BPP(int16_t x, int16_t y, int16_t w, int16_t h,
                     const uint8_t *pixels, const uint16_t *palette);

  // writeRect4BPP -  write 4 bit per pixel paletted bitmap
  //          bitmap data in array at pixels, 4 bits per
  //pixel
  //          color palette data in array at palette
  //          width must be at least 2 pixels
  void writeRect4BPP(int16_t x, int16_t y, int16_t w, int16_t h,
                     const uint8_t *pixels, const uint16_t *palette);

  // writeRect2BPP -  write 2 bit per pixel paletted bitmap
  //          bitmap data in array at pixels, 4 bits per
  //pixel
  //          color palette data in array at palette
  //          width must be at least 4 pixels
  void writeRect2BPP(int16_t x, int16_t y, int16_t w, int16_t h,
                     const uint8_t *pixels, const uint16_t *palette);

  // writeRect1BPP -  write 1 bit per pixel paletted bitmap
  //          bitmap data in array at pixels, 4 bits per
  //pixel
  //          color palette data in array at palette
  //          width must be at least 8 pixels
  void writeRect1BPP(int16_t x, int16_t y, int16_t w, int16_t h,
                     const uint8_t *pixels, const uint16_t *palette);
 
Back
Top