Comment puis-je convertir une image WMF au format GIF ou PNG avec Delphi?
-
21-09-2019 - |
La solution
PNG est pas difficile, Delphi 2009 inclut TPNGImage. Pour GIF, vous pouvez utiliser GDI + ou le composant TGIFImage ...
Voici le code:
procedure Test;
var
p : TPicture;
png : TPngImage;
begin
try
p := TPicture.Create;
p.LoadFromFile('c:\INPUT.WMF');
png := TPngImage.CreateBlank(COLOR_RGB, 8, p.Width, p.Height);
png.Canvas.Draw(0,0, p.Graphic);
png.SaveToFile('C:\OUTPUT.png');
finally
Free(p);
Free(png);
end;
end;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow