Truncated image when pushed to sprite

I'm trying to push an image into a sprite, but I'm having an issue with getting the image to fully display. I want the background sprite to be fullscreen at 320x240, but if the sprite is created at anything over 320x172, the image won't display. The code is super basic, but I'm baffled whats preventing it to fill the screen. I'm using an ESP32 Dev board . Any ideas on what I'm missing here? Code is below, but I'll leave out the image.h file to save space. Pics show the image pushed to tft and sprite.
TIA!

#include <TFT_eSPI.h>
#include <SPI.h> 
#include "image.h"

TFT_eSPI tft = TFT_eSPI(); 
TFT_eSprite background= TFT_eSprite(&tft);

void setup() {
 tft.init();
 tft.setRotation(3);
 tft.setSwapBytes(true);

 background.createSprite(320,172);  //image won't display if y > 172
 background.setSwapBytes(true);
}

void loop() {
 background.pushImage(0,0,320,240,image);  
// tft.pushImage(0,0,320,240,image);  //full image is displayed
 background.pushSprite(0,0);
}

20240524_064646
20240524_064543

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.