Question

Est-il possible de convertir un WMF image GIF ou PNG avec Delphi 2009 (ou plus récent) bibliothèques d'exécution? Sinon, quelle bibliothèque conversion d'image recommanderiez-vous?

Était-ce utile?

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
scroll top