| 3 |  | uses | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 4 |  | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 5 |  | Dialogs, StdCtrls, Template, ExtCtrls, Math, StrUtils, | 
 
 
 
 
 
 
 
 
 
 
 | 6 | < | ConnectionManager, {OniImgClass,} Data, TypeDefs, Menus, Buttons; | 
 
 
 
 
 
 
 
 
 | 6 | > | ConnectionManager, OniImgClass, Data, TypeDefs, Menus, Buttons; | 
 
 
 
 
 
 
 
 
 
 
 | 7 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 8 |  | type | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 9 |  | TForm_Preview = class(TForm_ToolTemplate) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 83 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 84 |  | procedure TForm_Preview.LoadImage(fileid, index: Integer); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 85 |  | var | 
 
 
 
 
 
 
 
 
 
 
 | 86 | < | Data:      TByteArray; | 
 
 
 
 
 
 
 
 
 | 86 | > | Data:      TByteData; | 
 
 
 
 
 
 
 
 
 
 
 | 87 |  | memstream: TMemoryStream; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 88 |  | OniImage:  TOniImage; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 89 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 90 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 91 |  | OniImage := TOniImage.Create; | 
 
 
 
 
 
 
 
 
 
 
 | 92 | < | OniImage.Load(Connection, fileid); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 93 | < | Data := OniImage.GetAsBMP; | 
 
 
 
 
 
 
 
 
 | 92 | > | OniImage.Load(ConnectionID, fileid); | 
 
 
 
 
 | 93 | > | OniImage.GetAsBMP(Data); | 
 
 
 
 
 
 
 
 
 
 
 | 94 |  | OniImage.Free; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 95 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 96 |  | memstream := TMemoryStream.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 146 |  | link: LongWord; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 147 |  | i:    Byte; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 148 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 | 149 | < | Connection.LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 150 | < | Connection.LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount); | 
 
 
 
 
 
 
 
 
 | 149 | > | ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed); | 
 
 
 
 
 | 150 | > | ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount); | 
 
 
 
 
 
 
 
 
 
 
 | 151 |  | SetBitmapCount(linkcount); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 152 |  | for i := 0 to linkcount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 153 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 | 154 | < | Connection.LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link); | 
 
 
 
 
 
 
 
 
 | 154 | > | ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link); | 
 
 
 
 
 
 
 
 
 
 
 | 155 |  | link := link div 256; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 156 |  | if link = 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 157 |  | link := _fileid - 1; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 189 |  | Dec(actualimg) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 190 |  | else | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 191 |  | actualimg := High(bitmaps); | 
 
 
 
 
 
 
 
 
 
 
 | 192 | < | Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + | 
 
 
 
 
 
 
 
 
 | 192 | > | Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name + | 
 
 
 
 
 
 
 
 
 
 
 | 193 |  | ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 194 |  | DrawImage(actualimg); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 195 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 201 |  | Inc(actualimg) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 202 |  | else | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 203 |  | actualimg := 0; | 
 
 
 
 
 
 
 
 
 
 
 | 204 | < | Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + | 
 
 
 
 
 
 
 
 
 | 204 | > | Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name + | 
 
 
 
 
 
 
 
 
 
 
 | 205 |  | ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 206 |  | DrawImage(actualimg); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 207 |  | end; |