The following demonstrates creating a resource file containing a JPEG image, and loading the JPEG file from the resource file. The resulting JPEG image is displayed in a Image component.
Create a text file with the extension of ".rc". The text file should be named something different than the project name or any unit name in your application to avoid any confusion for the compiler. The text file should contain the following line:
MYJPEG JPEG C:\DownLoad\MY.JPG
Where "MYJPEG" is the name you wish to name the resource "JPEG" is the user defined resource type. "C:\DownLoad\MY.JPG" is the path and filename of the JPEG file. For our example we will name the file "foo.rc".
Now run the BRCC32.exe (Borland Resource CommandLine Compiler) program found in the Delphi/C++ Builders bin directory giving the full path to the rc file:
C:\DelphiPath\BIN\BRCC32.EXE C:\ProjectPath\FOO.RC
You should now have a compiled resource file named the same as the ".rc" file you compiled with the extension of ".res".
The following demonstrates using the embedded JPEG in your application:
{Link the res file}
{$R FOO.RES}
To je to.
Izvini da nisam ranije napisao odgovor, samo nisam imao vremena.
|