Skip to main content
Associate II
April 21, 2024
Solved

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

  • April 21, 2024
  • 1 reply
  • 1047 views

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) * 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!

This topic has been closed for replies.
Best answer by JTP1

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

1 reply

JTP1Best answer
Graduate II
April 21, 2024

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