Fixed view with transparence. Fixed Another bit mode view. All extractable PNGs are paletted if TIM is such one. Preparing to Tim<->Png converting.

This commit is contained in:
meffi@lab313.ru
2014-04-24 17:24:09 +00:00
parent e2f38ea43d
commit b954de5b12
11 changed files with 262 additions and 195 deletions

27
uexportimport.pas Normal file
View File

@@ -0,0 +1,27 @@
unit uexportimport;
interface
uses FPWritePNG, zstream, udrawtim;
procedure SaveImage(Surf: PDrawSurf; Indexed: Boolean; const FileName: string; PngWriter: TFPWriterPNG);
function CreatePngWriter(ForExport: Boolean): TFPWriterPNG;
implementation
function CreatePngWriter(ForExport: Boolean): TFPWriterPNG;
begin
Result := TFPWriterPNG.Create;
Result.CompressionLevel := clnone;
Result.WordSized := False;
Result.UseAlpha := (not ForExport);
end;
procedure SaveImage(Surf: PDrawSurf; Indexed: Boolean; const FileName: string; PngWriter: TFPWriterPNG);
begin
PngWriter.Indexed := Indexed;
Surf^.SaveToFileUTF8(FileName, PngWriter);
end;
end.