Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does readrect() work on this display #123

Open
Chanete opened this issue Nov 10, 2023 · 1 comment
Open

Does readrect() work on this display #123

Chanete opened this issue Nov 10, 2023 · 1 comment

Comments

@Chanete
Copy link

Chanete commented Nov 10, 2023

Hi, I'm trying to write a function that will blink a part of the screen using readRect to get the contents, store them, empty that part of the screen and after a while, use pushRect to re-paint that area,

it doesn't work, readrect gives me a full-of-zeroes array.

I've read that some screens doesnt support readback. Is this the case? how can I solve this issue,

Thx in advance

This is my blink code:

void blink(int x, int y, int w, int h) {
    if (!isRectBlack) {
        Serial.println("Blink");
        if (originalContent == NULL) {
            originalContent = new uint16_t[w * h];  
        }
        tft.readRect(x, y, w, h, originalContent);  
        for (int f=0; f< w*h;f++)
          Serial.print(originalContent[f]); 
        tft.fillRect(x, y, w, h, TFT_BLACK);       
        isRectBlack = true;
    } else {
        Serial.println("Recover");
        tft.pushRect(x, y, w, h, originalContent); 
        isRectBlack = false;
        delete[] originalContent;
        originalContent = NULL;
    }
}
@3djc
Copy link

3djc commented Feb 21, 2024

The available lua functions is listed here : https://luadoc.edgetx.org/part_iii_-_opentx_lua_api_reference/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants