Programming C# C++ (7) Delphi (617) .NET (2) Database (71) Delphi IDE (89) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280) Java (8) JavaScript (31) perl (9) php (4) VBScript (1) Visual Basic (1)
Exchange Links About this site Links to us 
|
Include a JPEG in your EXE file
6 comments. Current rating: (1 votes). Leave comments and/ or rate it.
- Create a resource script file MyPic.RC with Notepad and add the following line:
1 RCDATA "Pic.jpg"
- Then use Borland's Resource Compiler BRCC32.EXE (a commandline tool)
to compile it into a .RES file:
BRCC32 MyPic.RC
- 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;
var
MyJPG : TJPEGImage; ResStream : TResourceStream; begin
try
MyJPG := TJPEGImage.Create;
ResStream := TResourceStream.CreateFromID(HInstance, 1, RT_RCDATA);
MyJPG.LoadFromStream(ResStream); Canvas.Draw(12,12,MyJPG); finally
MyJPG.Free;
ResStream.Free;
end;
end; | |  | |  |
Comments:
|
anonymousPDA from Hungary
|
|
|
|
BRCC32.EXE is not included in BD7 trial...
Where can I find it?
|
|
anonymous from Colombia
|
|
|
|
Same question here...
|
|
ptiemann_2000@yahoo.com 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..
|
|
[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 ?
|
|
|
|
|
what H-language is that?
|
|