This site is temporarily down. Please come back. Include a JPEG in your EXE file
DelphiFAQ Home Search:

Include a JPEG in your EXE file


commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

  1. Create a resource script file MyPic.RC with Notepad and add the following line:
    1  RCDATA  "Pic.jpg"
  2. Then use Borland's Resource Compiler BRCC32.EXE (a commandline tool)
    to compile it into a .RES file:
    BRCC32 MyPic.RC
  3. Add a compiler directive to the source code of your program.
    It should immediately follow the form directive, as shown here:
    {$R *.DFM}
    {$R MyPic.RES}
Use the following code in your application:

procedure LoadJPEGfromEXE;
  MyJPG : TJPEGImage; // JPEG object
  ResStream : TResourceStream; // Resource Stream object
    MyJPG := TJPEGImage.Create; 
    ResStream := TResourceStream.CreateFromID(HInstance, 1, RT_RCDATA);
    MyJPG.LoadFromStream(ResStream); // What!? Yes, that easy!
    Canvas.Draw(12,12,MyJPG); // draw it to see if it really worked!
end;  // procedure

Content-type: text/html


2006-01-27, 05:21:48
anonymousPDA from Hungary  
BRCC32.EXE is not included in BD7 trial...
Where can I find it?
2006-02-05, 18:49:18
anonymous from Colombia  
Same question here...
2006-02-05, 23:21:06 from United States  
Guys if you would leave an email address, I could help you out with BRCC32.exe
You can see my email up there..
2007-02-09, 22:15:52
[hidden] from India  
how do you create a resource script file? and what is it? isnt there a simple way to embed a .exe file in a jpeg picture file ?
2008-04-05, 15:17:59
what H-language is that?



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: