目的、Delphiでリソースファイルを使用します
この例は、プログラムにフラッシュアニメーションを追加し、プログラムが開始されたときにリリースすることです。
最初に新しいファイルを作成します
コンテンツの書き込み:Flash Swffile1ありがとう.swf
ASを保存:swffile.rc
次に、brcc32.exeを使用してリソースファイルを生成します
次に、Delphiに行(最後の行)を追加します
実装
{$ r *.dfm}
{$ r swffile.res} //これは行です
次に、手順を追加します。
手順FlashRestofile(const Resname、Restype、Filename:string);
var
フラッシュ:tresourcestream;
始める
Flashres:= tresourcestream.create(hinstance、resname、pchar(restype));
試す
flashres.savetofile(filename);
ついに
flashres.free;
終わり;
終わり;
使用:
flashRestofile( 'flash'、 'swffile1'、 'antys.swf');
shockwaveflash1.movie:= extractfilepath(paramstr(0)) + 'antys.swf';
shockwaveflash1.play;