From 12f02d2917a1c07ec7566d86942c6ae8b7df642f Mon Sep 17 00:00:00 2001 From: fvanroie Date: Fri, 3 Apr 2020 18:41:47 +0200 Subject: [PATCH] Fix Screenshot content length --- src/hasp_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 72ac2a62..76b38130 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -739,14 +739,14 @@ void guiTakeScreenshot(ESP8266WebServer & client) void guiTakeScreenshot(WebServer & client) #endif // ESP32{ { - webClient = &client; + webClient = &client; + lv_disp_t * disp = lv_disp_get_default(); - guiSnapshot = 2; - webClient->setContentLength(122 + 320 * 240 * 2); + webClient->setContentLength(122 + disp->driver.hor_res * disp->driver.ver_res * sizeof(lv_color_t)); webClient->send(200, PSTR("image/bmp"), ""); + guiSnapshot = 2; guiSendBmpHeader(); - lv_obj_invalidate(lv_scr_act()); lv_refr_now(NULL); /* Will call our disp_drv.disp_flush function */ guiSnapshot = 0;