| 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: Tdata; |
| 86 |
|
memstream: TMemoryStream; |
| 87 |
|
OniImage: TOniImage; |
| 89 |
– |
|
| 88 |
|
begin |
| 89 |
|
OniImage := TOniImage.Create; |
| 90 |
< |
OniImage.Load(Connection, fileid); |
| 93 |
< |
Data := OniImage.GetAsBMP; |
| 94 |
< |
OniImage.Free; |
| 95 |
< |
|
| 90 |
> |
OniImage.Load(ConnectionID, fileid); |
| 91 |
|
memstream := TMemoryStream.Create; |
| 92 |
< |
memstream.Write(Data[0], Length(Data)); |
| 93 |
< |
memstream.Seek(0, soFromBeginning); |
| 92 |
> |
OniImage.GetAsBMP(TStream(memstream)); |
| 93 |
> |
OniImage.Free; |
| 94 |
|
bitmaps[index].LoadFromStream(memstream); |
| 95 |
|
memstream.Free; |
| 96 |
|
end; |
| 137 |
|
procedure TForm_Preview.PreviewTXAN; |
| 138 |
|
var |
| 139 |
|
loop_speed: Word; |
| 140 |
< |
linkcount: LongWord; |
| 141 |
< |
link: LongWord; |
| 140 |
> |
linkcount: Integer; |
| 141 |
> |
link: Integer; |
| 142 |
|
i: Byte; |
| 143 |
|
begin |
| 144 |
< |
Connection.LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed); |
| 145 |
< |
Connection.LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount); |
| 144 |
> |
ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed); |
| 145 |
> |
ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount); |
| 146 |
|
SetBitmapCount(linkcount); |
| 147 |
|
for i := 0 to linkcount - 1 do |
| 148 |
|
begin |
| 149 |
< |
Connection.LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link); |
| 149 |
> |
ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link); |
| 150 |
|
link := link div 256; |
| 151 |
|
if link = 0 then |
| 152 |
|
link := _fileid - 1; |
| 184 |
|
Dec(actualimg) |
| 185 |
|
else |
| 186 |
|
actualimg := High(bitmaps); |
| 187 |
< |
Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + |
| 187 |
> |
Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name + |
| 188 |
|
' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; |
| 189 |
|
DrawImage(actualimg); |
| 190 |
|
end; |
| 196 |
|
Inc(actualimg) |
| 197 |
|
else |
| 198 |
|
actualimg := 0; |
| 199 |
< |
Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + |
| 199 |
> |
Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name + |
| 200 |
|
' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; |
| 201 |
|
DrawImage(actualimg); |
| 202 |
|
end; |