Thema: Prism TBitmap nach JPEG

Einzelnen Beitrag anzeigen

Mario

Registriert seit: 7. Apr 2003
567 Beiträge
 
Delphi 2006 Enterprise
 
#3

Re: TBitmap nach JPEG

  Alt 11. Mai 2005, 14:13
Nicht ganz, weil ich im Net bin

Aber so ging es, ich habe die einfache Lösung einfach nicht gesehen:

Delphi-Quellcode:
uses
  System.IO,
  system.Drawing,
  System.Drawing.Imaging,
  Graphics;

var aBmp: TBitmap;
    MS: System.IO.MemoryStream;
    Img: System.Drawing.Image;
begin
  aBmp := TBitmap.Create;
  aBmp.Width := 100;
  aBmp.Height := 200;

  aBmp.Canvas.Rectangle(10,10,90,150);

  MS := System.IO.MemoryStream.Create;
  aBmp.SaveToStream(MS);

  Img := System.Drawing.Image.FromStream(MS);
  Img.Save('test.jpg',System.Drawing.Imaging.Imageformat.Jpeg);
end.
Schöne Grüße,
Mario Noack
  Mit Zitat antworten Zitat