| 15 |
|
function GetHeight(MipGen: Integer): Integer; |
| 16 |
|
function GetImageFormat: TImageFormat; |
| 17 |
|
procedure SetImageFormat(Format: TImageFormat); |
| 18 |
+ |
function pGetImageFormatInfo: TImageFormatInfo; |
| 19 |
|
function GetHasMipMaps: Boolean; |
| 20 |
|
protected |
| 21 |
|
public |
| 24 |
|
property Width[MipGen: Integer]: Integer read GetWidth; |
| 25 |
|
property Height[MipGen: Integer]: Integer read GetHeight; |
| 26 |
|
property Format: TImageFormat read GetImageFormat write SetImageFormat; |
| 27 |
+ |
property FormatInfo: TImageFormatInfo read pGetImageFormatInfo; |
| 28 |
|
property HasMipMaps: Boolean read GetHasMipMaps; |
| 29 |
|
|
| 30 |
|
constructor Create; |
| 57 |
|
rect: TRect; |
| 58 |
|
begin |
| 59 |
|
InitImage(singleimg); |
| 60 |
< |
CloneImage(FImages[Index], singleimg); |
| 60 |
> |
CloneImage(FImages[Index-1], singleimg); |
| 61 |
|
ConvertImage(singleimg, ifX8R8G8B8); |
| 62 |
|
rect.Left := 0; |
| 63 |
|
rect.Top := 0; |
| 132 |
|
end; |
| 133 |
|
|
| 134 |
|
|
| 135 |
+ |
function TOniImage.pGetImageFormatInfo: TImageFormatInfo; |
| 136 |
+ |
begin |
| 137 |
+ |
if Length(FImages) > 0 then |
| 138 |
+ |
GetImageFormatInfo(FImages[0].Format, Result); |
| 139 |
+ |
end; |
| 140 |
+ |
|
| 141 |
+ |
|
| 142 |
|
function TOniImage.GetHasMipMaps: Boolean; |
| 143 |
|
begin |
| 144 |
|
Result := Length(FImages) > 1; |
| 432 |
|
ConManager.Connection[ConnectionID].LoadRawFile(fileid, $9C, TStream(data)) |
| 433 |
|
else |
| 434 |
|
ConManager.Connection[ConnectionID].LoadRawFile(fileid, $A0, TStream(data)); |
| 435 |
+ |
|
| 436 |
+ |
// data.Seek(0, soFromBeginning); |
| 437 |
+ |
// data.SaveToFile('m:\test.txmp'); |
| 438 |
+ |
|
| 439 |
|
data.Seek(0, soFromBeginning); |
| 440 |
|
result := LoadMultiImageFromStream(data, FImages); |
| 441 |
|
data.Free; |
| 442 |
< |
|
| 442 |
> |
{ |
| 443 |
> |
if result then |
| 444 |
> |
begin |
| 445 |
> |
for i := 0 to High(FImages) do |
| 446 |
> |
begin |
| 447 |
> |
data := TMemoryStream.Create; |
| 448 |
> |
data.Write(FImages[i].Bits^, FImages[i].Size); |
| 449 |
> |
data.Seek(0, soFromBeginning); |
| 450 |
> |
data.SaveToFile('m:\test.txmp.'+IntToStr(i)); |
| 451 |
> |
data.Free; |
| 452 |
> |
end; |
| 453 |
> |
end; |
| 454 |
> |
} |
| 455 |
|
if not result then |
| 456 |
|
begin |
| 457 |
|
ShowMessage('Error while loading file' + #13#10 + DetermineStreamFormat(data)); |