cancel
Showing results for 
Search instead for 
Did you mean: 

Resize updated area ... FrontendApplication::draw(Rect &rect)

niklasgro
Associate II

Hello, I'm trying to build a simple GUI Application with TouchGFX. And right now im trying to resize the updated area (make it bigger than needed) to get it byte aligned and because of other reasons as well.

I`ve found one Person who described it here. He has overwritten the Function 

 

void FrontendApplication::draw(Rect& rect) {
    // Make sure the draw area is always byte aligned
    rect.x -= (rect.x % 8);
    rect.width = ((rect.width + 7) / 😎 * 8;
    Application::draw(rect);
}

 

like this (Copyright to Mike Norgate - see the link).

I dont need exactly this function but i need to resize it at the same position in the code. So i tried to reproduced it but i got confused. I found here some mentioning of the function in touchgfx/Application.hpp but its mentioned under protected functions. So ive looked in my generated code, but in the TouchGFX/FrontendApplication.hpp there is no  function like this and i couldnt find a application.hpp as well. 

So I have no clue where I can find/overwrite the function to resize (make bigger) the area that is redrawn. I`m new to cpp and touchgfx. I hope theres an easy way to do it.

Thank you so much!

1 ACCEPTED SOLUTION

Accepted Solutions
JTP1
Lead

Hello

I suppose you can implement your customized draw-function to frontendApplicaton.hpp/.cpp like in this post

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/touchgfx-spi-partialbuffer-can-i-set-the-position-width-height/td-p/214104

Modify the files under /common/- folders

Hope this helps

Br JTP

View solution in original post

1 REPLY 1
JTP1
Lead

Hello

I suppose you can implement your customized draw-function to frontendApplicaton.hpp/.cpp like in this post

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/touchgfx-spi-partialbuffer-can-i-set-the-position-width-height/td-p/214104

Modify the files under /common/- folders

Hope this helps

Br JTP