--- oup/rewrite/Tools/Preview.pas 2007/01/18 17:15:59 93 +++ oup/current/Tools/Preview.pas 2007/02/21 03:28:48 111 @@ -3,7 +3,7 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Template, ExtCtrls, Math, StrUtils, - ConnectionManager, {OniImgClass,} Data, TypeDefs, Menus, Buttons; + ConnectionManager, OniImgClass, Data, TypeDefs, Menus, Buttons; type TForm_Preview = class(TForm_ToolTemplate) @@ -83,19 +83,14 @@ end; procedure TForm_Preview.LoadImage(fileid, index: Integer); var - Data: Tdata; memstream: TMemoryStream; OniImage: TOniImage; - begin OniImage := TOniImage.Create; - OniImage.Load(Connection, fileid); - Data := OniImage.GetAsBMP; - OniImage.Free; - + OniImage.Load(ConnectionID, fileid); memstream := TMemoryStream.Create; - memstream.Write(Data[0], Length(Data)); - memstream.Seek(0, soFromBeginning); + OniImage.GetAsBMP(TStream(memstream)); + OniImage.Free; bitmaps[index].LoadFromStream(memstream); memstream.Free; end; @@ -142,16 +137,16 @@ end; procedure TForm_Preview.PreviewTXAN; var loop_speed: Word; - linkcount: LongWord; - link: LongWord; + linkcount: Integer; + link: Integer; i: Byte; begin - Connection.LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed); - Connection.LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount); + ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed); + ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount); SetBitmapCount(linkcount); for i := 0 to linkcount - 1 do begin - Connection.LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link); + ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link); link := link div 256; if link = 0 then link := _fileid - 1; @@ -189,7 +184,7 @@ begin Dec(actualimg) else actualimg := High(bitmaps); - Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + + Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name + ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; DrawImage(actualimg); end; @@ -201,7 +196,7 @@ begin Inc(actualimg) else actualimg := 0; - Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + + Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name + ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; DrawImage(actualimg); end;