Resources are non-code data, such as images, text, audio or other files, that will be included in your application and can be accessed from code at runtime.
Different kinds of resources are supported on different platforms. In most cases, resources are packed up to be included inside the binary file generated by the compiler or linker; on the Cocoa (Cocoa and Island/Darwin platforms, resources usually remain standalone files inside the .
There are three broad types of resources:
EmbeddedResource files are supported on all platforms, but only very commonly used on .NET and native Island/Windows. As part of the build process, EmbeddedResource files get included in the main executable by the compiler or linker.
On .NET and Java, files of any types can be included as EmbeddedResource. Certain resource types will (based on file extension) be processed and packaged up differently. On Cocoa and all Island platforms, only
.res resource files can be included. (A small and specific set of other file types can be set as EmbeddedResource and will automatically packaged as
.res file during the build.)
.resxfiles are XML-based files that can contain values or reference to other (usually binary or media, such as bitmaps or icons) files. They will be converted to
.resourcefiles that include the data of any reference files, before being embedded.
.dfmfiles are text based files that define Delphi VCL forms. They will be converted to a binary format appropriate for the platform, before being embedded.
.rcfiles are text based files that describe Win32 resource; similar to
.resx, they can contain references to other (typically binary or media) files. A future version of EBuild will automatically compile
.resfiles, but for now, these files cannot be directly referenced and must be compiled externally using the
rc.exetool that comes with the Windows SDK.
.resfiles contain a set of resources packaged up in a Windows-specific binary format. They will be embedded as is, and are supported on all platforms.
On the .NET and Java platforms , all other files will be embedded as is, and can be accessed directly using the appropriate resource APIs for the platform. On Cocoa and Island, arbitrary resource files are not supported, only
.res files (or files from the above list that can be processed to
How embedded resources are accessed at runtime depends on the platform. Please refer to the following topics to get started:
- See Also Accessing Embedded Resources (.NET)
- See Also
- See Also
Resource files are supported on .NET only. They too are embedded in the executable, but packaged in a different internal format and accessed using different code patterns than EmbeddedResources. They are most commonly used in WPF applications, and built on top of the .NET infrastructure for EmbeddedResources.
See Also Accessing WPF Resources (.NET).
AppResource files are supported only on the Apple (Cocoa and Island/Darwin platforms. Any type of file (or even folder) can be marked as AppResource, and the file (or folder) will be copied "as is" into the