Browse Source

* load PNG direct over TLazIntfImage and TLazReaderPNG instead of TPortableNetworkGraphic

master
Bergmann89 11 years ago
parent
commit
eec4c82086
1 changed files with 8 additions and 15 deletions
  1. +8
    -15
      glBitmap.pas

+ 8
- 15
glBitmap.pas View File

@@ -5751,7 +5751,7 @@ const
MAGIC_LEN = 8;
PNG_MAGIC: String[MAGIC_LEN] = #$89#$50#$4E#$47#$0D#$0A#$1A#$0A;
var
png: TPortableNetworkGraphic;
reader: TLazReaderPNG;
intf: TLazIntfImage;
StreamPos: Int64;
magic: String[MAGIC_LEN];
@@ -5767,27 +5767,20 @@ begin
exit;
end;

png := TPortableNetworkGraphic.Create;
intf := TLazIntfImage.Create(0, 0);
reader := TLazReaderPNG.Create;
try try
png.LoadFromStream(aStream);
intf := png.CreateIntfImage;
try try
AssignFromLazIntfImage(intf);
except
result := false;
aStream.Position := StreamPos;
exit;
end;
finally
intf.Free;
end;
reader.UpdateDescription := true;
reader.ImageRead(aStream, intf);
AssignFromLazIntfImage(intf);
except
result := false;
aStream.Position := StreamPos;
exit;
end;
finally
png.Free;
reader.Free;
intf.Free;
end;
end;



Loading…
Cancel
Save