How do the icons of a program not have to be in a resource folder or something?

I'm using Java, but it's a pretty general question, actually.

When I load an image as a program icon (program icon, save, load, any icon) and change the folder where the icon is, naturally an error happens because the program looks for the icon at an outdated address.

As a solution, I created a resource folder in the same program project folder, to store the icons I'm using.

Why programs (such as Word, Adobe File Reader, Solidworks or AutoCAD, etc.) generally do not have, at least apparently, a folder with the icons used in the program? How does this happen?

Author: Werneck, 2016-08-31

1 answers

A standard executable can have resources within it in addition to the binary execution code. As you may already know this is called resources (name on Windows, but you can do on Linux also, and on MacOS it is used bundles).

Can be text or other various data formats, including images of various formats such as icons.

There are some utilities to see what has inside it or manipulate this data (Example, Example, Example ). Obviously a linker allows you to do this maintenance in its most basic form ( documentation of the linker from Microsoft). IDEs usually have something that helps with this. Have as do programmatically .

In thesis could do this in Java, but it already has to put other things together, it does not make so much difference to have something like that. What it could do is a mechanism of its own by creating a array of bytes and throw the bytes icon into it. You don't have much of a secret. Then take this array and do whatever you want as if you had read from a file.

 1
Author: Maniero, 2020-11-06 13:49:57