# Generate .c file for assets that are not used on a screen

**URL:** <http://forum.squareline.io/t/generate-c-file-for-assets-that-are-not-used-on-a-screen/391>\
**Category:** How to\
**Created:** [August 22, 2022, 8:24am UTC](http://forum.squareline.io/t/generate-c-file-for-assets-that-are-not-used-on-a-screen/391 "2022-08-22T08:24:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcraciun](http://forum.squareline.io/letter_avatar_proxy/v4/letter/g/59ef9b/32.png) [@gcraciun](http://forum.squareline.io/u/gcraciun)\
**Post date:** [August 22, 2022, 8:24am UTC](http://forum.squareline.io/t/generate-c-file-for-assets-that-are-not-used-on-a-screen/391/1 "2022-08-22T08:24:23Z")

</div>

Hi,  
I have some assets, .png’s, that have in SLS but I do not have them on any screen because I have 5 images and only one is displayed. The plan is to change the active picture from the code.  
Is there a way to tell SLS to generate files also for those assets?

For the moment I am putting them manually in the ui.h file like:  
`LV_IMG_DECLARE(ui_img_icn_syshealth_xxx_png);`  
And the files I generated by placing all of them on the screen and then kept the .c files and deleted the unvanted objects form the screen in SLS.

Thanks,  
Gabi

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [August 23, 2022, 7:12am UTC](http://forum.squareline.io/t/generate-c-file-for-assets-that-are-not-used-on-a-screen/391/2 "2022-08-23T07:12:39Z")

</div>

Hi,

I’ve also run into this problem a few times. Now SLS really generates only the images which are being used at least on one screen. What I can imagine as a solution is converting all the images from the asset folder.

What do you think?

---

<div class="post-metadata">

**Author:** ![gcraciun](http://forum.squareline.io/letter_avatar_proxy/v4/letter/g/59ef9b/32.png) [@gcraciun](http://forum.squareline.io/u/gcraciun)\
**Post date:** [August 23, 2022, 9:32am UTC](http://forum.squareline.io/t/generate-c-file-for-assets-that-are-not-used-on-a-screen/391/3 "2022-08-23T09:32:29Z")

</div>

That should work well from my point of view. If the user uses a makefile project he can add only the files he want/need to the ones being compiled, if the project is built with something like eclipse that builds all the files in a folder, the unwanted ones can be excluded. Or in the first place, if the assets are really not needed, they can be removed from SLS.

Koszi!  
Gabi

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [August 23, 2022, 9:53am UTC](http://forum.squareline.io/t/generate-c-file-for-assets-that-are-not-used-on-a-screen/391/4 "2022-08-23T09:53:32Z")

</div>

Great, I agree! It’s a simple change so we can include it in v1.1 too.
