Skip to main content
Associate
July 17, 2024
Solved

Do I have to use Bitmap::setCache if Bitmap::registerBitmapDatabase is already called beforehand?

  • July 17, 2024
  • 1 reply
  • 886 views

Hello,

I had a use case to add dynamic bitmaps in a project I joined, and I followed the documentation to make them work.
https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/dynamic-bitmaps

 

Surprisingly, I realized that the addresses of dynamic bitmaps are not as I would expect them. The code I added that called Bitmap::setCache seems to be ignored.

I dug into project internals and found that there is a call to registerBitmapDatabase during initialization, with cache parameter supplied, but there is not a lot about that function in the docs. Does this explain why my `setCache` was ignored?

Best answer by Mohammad MORADI ESFAHANIASL

Hello @MarPan ,

Yes, Bitmap::registerBitmapDatabase already contains setting cache region if it is provided to it, and cache memory can only be set once. Therefore, your call to setCache() will be ignored since the cache is already set.

I hope this answers your question!

1 reply

ST Employee
July 18, 2024

Hello @MarPan ,

Yes, Bitmap::registerBitmapDatabase already contains setting cache region if it is provided to it, and cache memory can only be set once. Therefore, your call to setCache() will be ignored since the cache is already set.

I hope this answers your question!