Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi TImage: Image als BMP, JPG, WMF, ICO, etc. speichern (https://www.delphipraxis.net/38674-timage-image-als-bmp-jpg-wmf-ico-etc-speichern.html)

Helmi 22. Jan 2005 16:22


TImage: Image als BMP, JPG, WMF, ICO, etc. speichern
 
Hallo,

ich habe in einem Image ein Bild und möchte dies nun speichern.

Mit
Code:
  Image1.Picture.SaveToFile();
kann ich ja das Picture als Bmp speichern, aber wie kann ich es als Jpg, wmf, ico, usw. speichern?

maxk 22. Jan 2005 16:33

Re: TImage: Image als BMP, JPG, WMF, ICO, etc. speichern
 
Du musst das Bild vorher in das richtige Grafikformat konvertieren.
Wenn du z.B. als JPEG speichern willst:
Delphi-Quellcode:
 with TJpegImage.Create do try
  Assign(Image1.Picture.Graphic);
  SaveToFile('C:\Test.jpg');
 finally
  Free;
 end;
Die Suchfunktion hilft dir für die anderenbestimmt weiter.

Binärbaum 22. Jan 2005 19:11

Re: TImage: Image als BMP, JPG, WMF, ICO, etc. speichern
 
Für die Icons und die Metafiles müsste es doch auch gehen, da diese eigene Property haben. (z.B. Image1.Picture.Icon usw.)
Dabei muss man aber je nach Typ des Bildes (BMP, ICO, WMF/EMF) unterscheiden, welche man nimmt.

MfG
Binärbaum


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:08 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz