Fix transparency issue

add auto snapshot
This commit is contained in:
Luc 2019-08-17 21:38:51 +02:00
parent adbbd9067c
commit a71be60eff
6 changed files with 617 additions and 609 deletions

View File

@ -34,7 +34,7 @@
#define ETH_FEATURE #define ETH_FEATURE
//BLUETOOTH_FEATURE : enable BT Serial function //BLUETOOTH_FEATURE : enable BT Serial function
#define BLUETOOTH_FEATURE //#define BLUETOOTH_FEATURE
//HTTP_FEATURE : enable HTTP function //HTTP_FEATURE : enable HTTP function
#define HTTP_FEATURE #define HTTP_FEATURE
@ -161,6 +161,7 @@
#if defined (DISPLAY_DEVICE) && (DISPLAY_UI_TYPE == UI_TYPE_ADVANCED) #if defined (DISPLAY_DEVICE) && (DISPLAY_UI_TYPE == UI_TYPE_ADVANCED)
//allows to use [ESP216]SNAP to do screen capture //allows to use [ESP216]SNAP to do screen capture
#define DISPLAY_SNAPSHOT_FEATURE #define DISPLAY_SNAPSHOT_FEATURE
#define AUTO_SNAPSHOT_FEATURE
#endif //DISPLAY_DEVICE #endif //DISPLAY_DEVICE
/************************************ /************************************

View File

@ -168,10 +168,6 @@ bool Display::startCalibration()
uint16_t calibrationData[5]; uint16_t calibrationData[5];
show_screenID(CALIBRATION_SCREEN); show_screenID(CALIBRATION_SCREEN);
update_screen(true); update_screen(true);
//display instructions
/*uint size = getStringWidth("Touch corners as indicated");
setTextFont(FONTCALIBRATION);
drawString("Touch corners as indicated", (SCREEN_WIDTH-size)/2, (SCREEN_HEIGHT-16)/2, CALIBRATION_FG);*/
esp3d_screen.calibrateTouch(calibrationData, CALIBRATION_CORNER, CALIBRATION_BG, 20); esp3d_screen.calibrateTouch(calibrationData, CALIBRATION_CORNER, CALIBRATION_BG, 20);
res = true; res = true;
for (uint8_t i = 0; i < 5; i++) { for (uint8_t i = 0; i < 5; i++) {
@ -353,6 +349,13 @@ bool Display::display_IP(bool force)
void Display::show_screenID(uint8_t screenID) void Display::show_screenID(uint8_t screenID)
{ {
if (_screenID != screenID){ if (_screenID != screenID){
#if defined(AUTO_SNAPSHOT_FEATURE)
if (_screenID != -1){
String s = "/snap" + String(_screenID);
s+=".bin";
snapshot((char *)s.c_str());
}
#endif //AUTO_SNAPSHOT_FEATURE
_screenID = screenID; _screenID = screenID;
clear_screen(); clear_screen();
switch (screenID) { switch (screenID) {
@ -630,11 +633,15 @@ void Display::progress(uint8_t v)
bool Display::snapshot() bool Display::snapshot(char * filename)
{ {
bool res = false; bool res = false;
#if defined(DISPLAY_SNAPSHOT_FEATURE) #if defined(DISPLAY_SNAPSHOT_FEATURE)
if(filename) {
fsSnapFile = ESP_FileSystem::open(filename, ESP_FILE_WRITE);
}else {
fsSnapFile = ESP_FileSystem::open(SNAPFILENAME, ESP_FILE_WRITE); fsSnapFile = ESP_FileSystem::open(SNAPFILENAME, ESP_FILE_WRITE);
}
if (!fsSnapFile) { if (!fsSnapFile) {
return false; return false;
} }

View File

@ -42,7 +42,7 @@ public:
void progress(uint8_t v); void progress(uint8_t v);
void SetStatus(const char * status); void SetStatus(const char * status);
bool startCalibration(); bool startCalibration();
bool snapshot(); bool snapshot(char * filename = nullptr);
private: private:
bool _started; bool _started;
uint8_t _screenID; uint8_t _screenID;

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -41,7 +41,7 @@
#define LV_COLOR_SCREEN_TRANSP 0 #define LV_COLOR_SCREEN_TRANSP 0
/*Images pixels with this color will not be drawn (with chroma keying)*/ /*Images pixels with this color will not be drawn (with chroma keying)*/
#define LV_COLOR_TRANSP LV_COLOR_MAKE( 0x00, 0xFF, 0x00) #define LV_COLOR_TRANSP LV_COLOR_MAKE( 0xFF, 0x00, 0xFF)
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */ /* Enable anti-aliasing (lines, and radiuses will be smoothed) */
#define LV_ANTIALIAS 1 #define LV_ANTIALIAS 1