Fix Screenshot content length

This commit is contained in:
fvanroie 2020-04-03 18:41:47 +02:00
parent 85f82e3c9c
commit 12f02d2917

View File

@ -739,14 +739,14 @@ void guiTakeScreenshot(ESP8266WebServer & client)
void guiTakeScreenshot(WebServer & client) void guiTakeScreenshot(WebServer & client)
#endif // ESP32{ #endif // ESP32{
{ {
webClient = &client; webClient = &client;
lv_disp_t * disp = lv_disp_get_default();
guiSnapshot = 2; webClient->setContentLength(122 + disp->driver.hor_res * disp->driver.ver_res * sizeof(lv_color_t));
webClient->setContentLength(122 + 320 * 240 * 2);
webClient->send(200, PSTR("image/bmp"), ""); webClient->send(200, PSTR("image/bmp"), "");
guiSnapshot = 2;
guiSendBmpHeader(); guiSendBmpHeader();
lv_obj_invalidate(lv_scr_act()); lv_obj_invalidate(lv_scr_act());
lv_refr_now(NULL); /* Will call our disp_drv.disp_flush function */ lv_refr_now(NULL); /* Will call our disp_drv.disp_flush function */
guiSnapshot = 0; guiSnapshot = 0;