Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi TCanvas in JPEG-Datei speichern (https://www.delphipraxis.net/36391-tcanvas-jpeg-datei-speichern.html)

Aenogym 19. Dez 2004 14:07


TCanvas in JPEG-Datei speichern
 
hi ihr,

ich versuche grad, den inhalt eines TCanvas in einem jpeg-bild abzuspeichern. aber irgendwie bekomme ich das grad nicht hin. mein code:

Delphi-Quellcode:
var temp: TImage;
begin
  temp := TImage.Create(self);
  try
    temp.Width := 289;
    temp.height := 73;
    loggraph1.CopyCanvasTo(temp.Picture.Bitmap.Canvas); //beschreibung siehe unten
    userstats.Assign(temp.Picture.Graphic);
    userstats.SaveToFile(extractfilepath(paramstr(0))+'users.jpg');
  finally
    temp.free;
  end;
mit loggraph1.CopyCanvasTo(temp.Picture.Bitmap.Canvas) ; kopiere ich einen graphen auf ein canvas. und genau den inhalt dieses canvas möchte ich irgendwie in eine jpeg-datei speichern.

könnt ihr mir helfen?

danke schonmal,
Aenogym

Luckie 19. Dez 2004 14:09

Re: TCanvas in JPEG-Datei speichern
 
Erst den Canvas in ein TBitmap kopieren und dann in ein JPG umwandeln.


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:15 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