Bodmer / TFT_eFEX

A support library for TFT_eSPI that adds commonly used extra functions
Other
83 stars 27 forks source link

Copy jpg via TFT_eFEX to sprite #46

Open powersoft opened 1 year ago

powersoft commented 1 year ago

I try to copy a jpg file using the TFT_eFEX procedure. The result of my code is that fex.drawJpgFile is drawing direct to the tft, instead of the command spr.pushSprite. What is wrong with my code?

`#define FS_NO_GLOBALS

include "FS.h"

include

ifdef ESP32

include "SPIFFS.h" // Needed for ESP32 only

endif

include

// https://github.com/Bodmer/TFT_eSPI

include // Hardware-specific library

TFT_eSPI tft = TFT_eSPI(); // Invoke custom library TFT_eSprite spr = TFT_eSprite(&tft); // Declare Sprite object "spr" with pointer to "tft" object

// https://github.com/Bodmer/TFT_eFEX

include // Include the extension graphics functions library

TFT_eFEX fex = TFT_eFEX(&spr); // Create TFT_eFX object "efx" with pointer to "tft" object

uint8_t sdSelectPin = 25;

void setup() { Serial.begin(250000);

tft.begin(); tft.setRotation(1); // 0 & 2 Portrait. 1 & 3 landscape spr.createSprite(192,192); // clear tft and sprite spr.fillScreen(TFT_BLACK); tft.fillScreen(TFT_BLACK);

// init SD and SPIFFS if (!SD.begin(sdSelectPin)) Serial.println("SD Card Mount Failed"); else Serial.println("SD Card Mount");

if (!SPIFFS.begin()) Serial.println("SPIFFS initialisation failed!"); else Serial.println("SPIFFS initialisation okee!")

// draw picture to sprite spr fex.drawJpgFile(SD, "/moon/180.jpg", 0, 0); //<======== // push sprite on LCD spr.pushSprite(200,0); <===== }

void loop() { // put your main code here, to run repeatedly: }`

stephensaid commented 1 year ago

I have the same problem. Have you fixed this?