Skip to main content
Jcoop.1
Associate II
October 17, 2024
Solved

swipecontainer slow due to rerendering of SVG images

  • October 17, 2024
  • 2 replies
  • 714 views

I'm currently developing a touchpanel on a H7a3 in which i use a swipecontainer on the main page.

In this swipecontainer are multiple buttons with each time a svg image on it. 

On scrolling this, the srolling is very shaky and slow. Measuring reveals that the rendertime is more then 75ms.

Replacing the svg images with regular bitmaps solved the issue. 

Now is my question, why are apparently the svg images rendered every time the swipecontainer moves?

One would expect that this is only a shift of a memory zone so should only be a copy action? 

 

many thanks in advance

Best answer by Mohammad MORADI ESFAHANIASL

Hello @Jcoop.1,

SVGs are not cached and should be redrawn each time they are moved. So, if you need to save up flash storage by using SVGs, but due to their performance you cannot do that, I suggest using Dynamic Bitmaps instead.

If you have more questions, don't hesitate to ask!

2 replies

Associate
October 18, 2024

I am having the same issue, using png images instead solves the issue, but I would rather keep on using svg images. Any help on this would be really appreciated.

ST Employee
October 18, 2024

Hello @Jcoop.1,

SVGs are not cached and should be redrawn each time they are moved. So, if you need to save up flash storage by using SVGs, but due to their performance you cannot do that, I suggest using Dynamic Bitmaps instead.

If you have more questions, don't hesitate to ask!