熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Delphi編程 >> 正文

把Flash文件轉換為Exe文件

2013-11-23 17:35:33  來源: Delphi編程 
下面的代碼把一個Flash文件轉換為exe文件

function SwfExe(S D F: string): string;
//S = Source file (swf)
//D = Destionation file (exe)
//F = Flash Player
var
SourceStream DestinyStream LinkStream: TFileStream;
flag: Cardinal;
SwfFileSize: Integer;
begin
Result := something error;
DestinyStream := TFileStreamCreate(D fmCreate);
try
LinkStream := TFileStreamCreate(F fmOpenRead or fmShareExclusive);
try
DestinyStreamCopyFrom(LinkStream );
finally
LinkStreamFree;
end;

SourceStream := TFileStreamCreate(S fmOpenRead or fmShareExclusive);
try
DestinyStreamCopyFrom(SourceStream );
flag := $FA;
DestinyStreamWriteBuffer(flag SizeOf(Integer));
SwfFileSize := SourceStreamSize;
DestinyStreamWriteBuffer(SwfFileSize SizeOf(Integer));
Result := ;
finally
SourceStreamFree;
end;
finally
DestinyStreamFree;
end;
end;

procedure TFormButtonClick(Sender: TObject);
begin
SwfExe(c:\somefileswf c:\somefileexe
c:\Program Files\Macromedia\Flash MX\Players\SAFlashPlayerexe);
end;

    有了這個你就可以制作自己的Flash賀卡了
From:http://tw.wingwit.com/Article/program/Delphi/201311/24736.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.