Вниз
Скачать: CL | DM;

Параметры Flash-файла   Найти похожие ветки 

← →
QuickFinder   (2006-04-06 17:37) [0]

Как определить оригинальную длину и оригинальную ширину фрейма в SWF-файле?


← →
QuickFinder   (2006-04-06 17:38) [1]

Точнее, ширину и высоту.


← →
Sapersky   (2006-04-06 18:04) [2]

Наверное, можно как-то проще - не разбирался, просто скопировал откуда-то:

Type
 TSWFHeader = packed record
   SIGN : array [0..2] of Char;
   Version : Byte;
   FileSize : Integer;
   MovieRect : TRect;
   FPS : Word;
   FramesCount : Word;
 end;

Var
   FHeader : TSWFHeader;

function IsBitSet(val, TheBit : Byte): boolean;
begin
Result := (val and (1 shl TheBit)) <> 0;
end;

function BitInString(Const HeaderS: String; TheBit: byte): boolean;
var a,b,c: byte;
begin
a:=TheBit shr 3;
b:=a shl 3;
inc(a);
c:=TheBit-b;
result:=IsBitSet(ord(HeaderS[a]),7-c);
end;

function BitOn(val: Integer; TheBit: byte): Integer;
begin
Result := val or (1 shl TheBit);
end;

function BitLenth(Const HeaderS: String) : Byte;
begin
result := ord(HeaderS[1]) shr 3;
end;

function MovieSize(const s: String): TPoint;
var i,a,b: byte;
begin
Result.x:=0; Result.y:=0;

a:=Ord(s[1]) shr 3;
b:=4 + (a shl 1);
for I := 4+a to b do begin
 If BitInString(s,i) then Result.x:=BitOn(Result.x,a);
 Dec(a);
end;

a:=Ord(s[1]) shr 3;
b:=4 + a shl 2;
for I := 4 + a * 3 to b do begin
 if BitInString(s,I) then Result.y:=BitOn(Result.y,a);
 Dec(a);
end;

Result.x:=Result.x div 20; Result.y:=Result.y div 20;
end;

function LoadHeader: Boolean;
Var fs: TFileStream;
   buf : String;
begin
fs:= TFilestream.Create( FFilename, fmOpenRead or fmShareDenyWrite );

fs.Read(FHeader,8);
SetLength(buf, 17);
fs.Readbuffer(buf[1], 17);
fs.Free;

FHeader.MovieRect.BottomRight:=MovieSize(buf);
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.032 c
6-1150630488
Прогер
2006-06-18 15:34
2006.11.12
Есть ли данные для чтения? idTCPClient


15-1161900291
ArtemESC
2006-10-27 02:04
2006.11.12
Си - чего ему не нравится?


9-1138866264
Nic
2006-02-02 10:44
2006.11.12
Как проверить установлена DirectX в системе и если нет, то...


2-1161141970
kidm
2006-10-18 07:26
2006.11.12
Помогите решить задачку


15-1161933126
Jolik
2006-10-27 11:12
2006.11.12
Есть работа...




   Наверх