Skip to main content
LTing
Associate II
September 7, 2019
Question

Is it possible to modify the function “void Image::setBitmap(const Bitmap& bmp)�??

  • September 7, 2019
  • 8 replies
  • 1907 views

​Is it possible to modify the function “void Image::setBitmap(const Bitmap& bmp)�??

I tried to modify this function in the file "\framework\source\touchgfx\widgets\Image.cpp", but the code I modified is useless. Even if I remove this function from Image.cpp, the project can still be successfully built.

This topic has been closed for replies.

8 replies

Martin KJELDSEN
Principal III
September 9, 2019

Hi,

What do you mean by "but the code I modified is useless."? The code is open source to you, so what you're editing is what's getting compiled and linked into your application.

Why would you modify this file? Just trying to understand your motivation :)

/Martin

LTing
LTingAuthor
Associate II
September 11, 2019

Hi Martin,

Sorry I did not express the problem clearly.

What puzzles me is:​ I modified the code as below, all images still display normally. So I think may be there is an same class and same function(setBitmap) in the touchgfx lib, the function in touchgfx lib is the one that is actually available.

0690X00000AQz9VQAT.png

The reason I am modifying the code is hard to say clearly. Due to insufficient RAM, I have to store the image data in Norflash. I tried to redefine LOCATION_EXTFLASH_ATTRIBUTE, but the hardware does not support this feature. Therefore, in order to display the image, I must first cache the bitmap into RAM and then display it using the function "dynamicBitmapCreate". There are hundreds of images, I don't want to modify them one by one. If I can modify the function "setBitmap", I can easily modify the display method of all the images.