cancel
Showing results for 
Search instead for 
Did you mean: 

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

MarPan
Associate

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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!

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

1 REPLY 1

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!

Mohammad MORADI
ST Software Developer | TouchGFX