sukesh-ak / ESP32-TUX

ESP32-TUX - ESP32 / ESP32-XX Touch UX Template using LVGL to get you started
https://tux.sukesh.me
MIT License
235 stars 55 forks source link

Hardware display rotation #43

Closed THE-KONDRAT closed 10 months ago

THE-KONDRAT commented 1 year ago

Hi. I want to set default orientation as landscape. I tried to change conf_WT32SCO1.h (width and height in defines) and helper_display.hpp (lcd.setRotation(3 instead of 2) ). Orientation changes but display width crops by 320 pixels. I using WT32-SC01. How can i change display orientation?

sukesh-ak commented 1 year ago

Hi. I want to set default orientation as landscape. I tried to change conf_WT32SCO1.h (width and height in defines) and helper_display.hpp (lcd.setRotation(3 instead of 2) ). Orientation changes but display width crops by 320 pixels. I using WT32-SC01. How can i change display orientation?

Display default orientation is setup here. Try changing and see if it works for your requirements https://github.com/sukesh-ak/ESP32-TUX/blob/37822a7b6dfcb67e278c78b2aa468817b6fa0bbe/main/helpers/helper_display.hpp#L91

THE-KONDRAT commented 1 year ago

With lcd.setRotation(2) display orientation is portrait. 20231027_184529

With lcd.setRotation(1) display orientation is landscape but with black area on the right. 20231027_185728

If i rotate display (with lcd.setRotation(2)) from ui it works. How can i fix that?

sukesh-ak commented 1 year ago

With lcd.setRotation(2) display orientation is portrait. 20231027_184529

With lcd.setRotation(1) display orientation is landscape but with black area on the right. 20231027_185728

If i rotate display (with lcd.setRotation(2)) from ui it works. How can i fix that?

Background image needs to be changed to cover the side. Guess you figured that out yourself.

THE-KONDRAT commented 1 year ago

Ok. I temporary disabled background image, but the black area still exists. Looks like the image width is 320 pix instead of 480.

THE-KONDRAT commented 1 year ago

It works. I changed the width and height in helper and set rotation 1 instead of 3. And i set sw_rotate=0. But it doesn't look right. Is there another way to rotate the picture?

sukesh-ak commented 10 months ago

It works. I changed the width and height in helper and set rotation 1 instead of 3. And i set sw_rotate=0. But it doesn't look right. Is there another way to rotate the picture?

You might need 2 images, one for each orientation and dynamically load it.