cancel
Showing results for 
Search instead for 
Did you mean: 

How to know if an image is used in TouchGFX

BGuth.1
Senior

A lot of images are uploaded in to my TouchGFX project. I would like to removed unused images from there. How would I know if a particular image is used in the project or not? For example, Texts -> Typographies tab shows how many uses a particular font has. Similarly, is there a way to know if a particular image is used or not?

1 ACCEPTED SOLUTION

Accepted Solutions

I tried it again and this time it worked. The only difference is that the project with 4.16.1 grew more than last time. Not sure what the reason was but it worked this time. Thanks.

View solution in original post

9 REPLIES 9
MM..1
Chief III

Simply check and search in code every image ID from database. Designer dont count about...

I thought about this approach. But this is a long and time consuming approach considering number of images in the project. I am trying to see if there is an easier way like the text fonts I mentioned above.

in header file for example

const uint16_t BITMAP_BL1_ID = 0;
const uint16_t BITMAP_BL2_ID = 1;
const uint16_t BITMAP_BLB_ID = 2;
const uint16_t BITMAP_BLW_ID = 3;

comment all out and build

you see errors on used IDs

Alexandre RENOUX
Principal

Hello BGuth.1,

Are you using the latest version of TouchGFX Designer (4.18.1) ?

Because the number of uses is clearly shown for images as well

0693W00000KbNVuQAN.pngWhen your question is answered, please close this topic by choosing Select as Best.

/Alexandre

I am using v4.16.1. I tried to migrate to 4.18.1 but encountered problems. Please see https://community.st.com/s/question/0D53W00001KRP0USAX/error-with-touchgfx-conversion-from-4170-to-4181.

I was requested to send the project to you guys. But I am not able to do that. May be you can suggest a solutions based on the information posted in there so far. Please let me know.

Good to know the feature exists in v4.18.1.

I check this in 4.18.1 and counted is only images used in designer. I have many images used from code and show Uses zero.

Hello MM..1,

You are correct, and I'm glad you mentioned it since it could also be mentioned by other people ^^

The Designer does not read your user code so it is normal that the number of uses from code is not recognized by the Designer.

Best regards,

Alexandre

Hello BGuth.1,

The thing is that you must have done something unexpected in your project for the font converter to not work properly when trying to upgrade.

Without a project or details on how you manage text, it's difficult to know what's wrong.

One thing you could do is to delete TouchGFX library folder, generated/ folder, build/ folder and try to upgrade again

Is your project GUI only or hardware related ?

/Alexandre

I tried it again and this time it worked. The only difference is that the project with 4.16.1 grew more than last time. Not sure what the reason was but it worked this time. Thanks.