Is it possible to store an AVI file in the resource file?How to achieve
this?
With Regards,
Praveen Naregal
1) Add a MyAVI.RC file to your project (it's a straight text file),
which contains:
MYAVI1 RCDATA c:\test\myavi1.avi
MYAVI2 RCDATA c:\test\myavi2.avi
When you have this added to your Delphi project, the IDE will compile
it into a .RES file.
2) Add an "include" clause to one of your units, where you will be
using these AVI's:
unit MyAVIs;
{$R MyAVI.RES}
3) To get at the AVI, you can open a resource stream, and get a hold
of a given AVI resource like so:
uses
Classes;
var
rsmAVIs : TResourceStream;
begin
rsmAVIs := TResourceStream.Create(hInst, 'MYAVI1', RT_RCDATA);
Now you have a stream which contains the AVI.
Also, you could use TAnimate directly and specify the ResHandle and
ResName properties, to refer to a resource AVI.
Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.sch...@inova.ch
I have been able to create the resouce file as per your instructions.
But I am not able to load the AVI into TAnimate. This is what I have done.
I have created avi.rc file and added it to the project.It compiled
successfully and a avi.res file is created.I included this .res file to the
application and created the resouce stream.
Now how to load this resouce into TAnimate control and play the AVI.
Thanks & Regards,
Praveen Naregal
"Marc Scheuner" <no....@for.me> wrote in message
news:05go6vcqi6ea84v2q...@4ax.com...
Once you have a TAnimate on your form (drop it onto the form, or
create it in code), you should be able to just specify that resource
name, and off you go:
var
oAnimate : TAnimate;
begin
oAnimate := TAnimdate.Create(self);
oAnimate.ResHandle := hInstance;
oAnimate.ResName := 'MyAVI_in_RES';
oAnimate.Active := True;
end;
You might want to check out these links:
http://delphi.about.com/library/weekly/aa021301a.htm
http://delphi.about.com/library/weekly/aa113099.htm
I got it.I am able to store AVI files in resource files and use them.
Thanks for your help.
Regards,
Praveen Naregal
"Marc Scheuner" <no....@for.me> wrote in message
news:05go6vcqi6ea84v2q...@4ax.com...