You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is (was) that the TFT_eFEX::drawJpg was not applying the necessary offset to the picture and as a result the picture was cropped/not centered. And in fact it looked like it was ignoring configurations that are applied to the TFT_eSPI object such as the setOrientation.
where jpeg.tft is assigned the extended TFT_eFEX object (this same as tft_x from my code above) which is itself also a TFT_eSPI object but not the original one on which the configurations are applied. The original object (tft from my code) is stored in tft_x during TFT_eFEX instantiation here
_tft = tft; // Pointer to tft class so we can call member functions
So I changed the line 1488 to jpeg.tft = _tft;
and that fixed this particular problem that I had. But I'm not sure if this would create other problems. Is this a bug that I found, or is this just a workaround for my lack of understanding on how to use the library properly?
Alternatively could I instead apply configurations on the extended object directly like so
I have roughly the following setup
I have an ESP32 TTGO with ST7789_DRIVER
CGRAM_OFFSET
is definedmy code is:
The problem is (was) that the TFT_eFEX::drawJpg was not applying the necessary offset to the picture and as a result the picture was cropped/not centered. And in fact it looked like it was ignoring configurations that are applied to the TFT_eSPI object such as the setOrientation.
I traced it to this line
TFT_eFEX/TFT_eFEX.cpp
Line 1488 in 2b12725
where jpeg.tft is assigned the extended TFT_eFEX object (
this
same astft_x
from my code above) which is itself also a TFT_eSPI object but not the original one on which the configurations are applied. The original object (tft
from my code) is stored intft_x
during TFT_eFEX instantiation hereTFT_eFEX/TFT_eFEX.cpp
Line 18 in 2b12725
So I changed the line 1488 to
jpeg.tft = _tft;
and that fixed this particular problem that I had. But I'm not sure if this would create other problems. Is this a bug that I found, or is this just a workaround for my lack of understanding on how to use the library properly?
Alternatively could I instead apply configurations on the extended object directly like so
And if that is possible do I need to instantiate TFT_eSPI at all ? Can't I just use TFT_eFEX?
The text was updated successfully, but these errors were encountered: