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:
27
uexportimport.pas
Normal file
27
uexportimport.pas
Normal 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.
|
||||
|
||||
Reference in New Issue
Block a user