Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Bild wird nicht gedreht! (https://www.delphipraxis.net/31703-bild-wird-nicht-gedreht.html)

The Re@l 12. Okt 2004 19:45


Bild wird nicht gedreht!
 
Code:
procedure TForm1.FileListBox1Click(Sender: TObject);

 var
  Jpeg: TJpegImage;
  bmp: TBitmap;
begin
  Jpeg:=TJpegImage.Create;
  bmp := TBitmap.Create;

  try

    jpeg.LoadFromFile(FileListBox1.FileName);
    bmp.Assign(jpeg);
    Image1.Picture.Bitmap.PixelFormat := pf24bit;
    Drehen90Grad(Image1.Picture.Bitmap);
    Image1.Picture.Assign(bmp);

  finally
    jpeg.free;
         end;

end;
Wenn ich die Procedure Drehen90Grad in einem Button verwende und danach Image.refresh; mache dann gehts!
warum so nicht?

Matze 12. Okt 2004 19:46

Re: Bild wird nicht gedreht!
 
Du hast, so wie ich das sehe, das Bild gar nicht in Image1 geladen, oder täusche ich mich da? :gruebel:

SirThornberry 12. Okt 2004 19:48

Re: Bild wird nicht gedreht!
 
Der fehler liegt hier
Delphi-Quellcode:
    Drehen90Grad(Image1.Picture.Bitmap);
    Image1.Picture.Assign(bmp);
du Drehst "Image1.Picture.Bitmap" und danach überschreibst du "Image1.Picture.Bitmap" mit "bmp"

Nicodius 12. Okt 2004 19:48

Re: Bild wird nicht gedreht!
 
nein du hast einfach kein bild drinnen ans mage übergeben :stupid:

The Re@l 12. Okt 2004 19:54

Re: Bild wird nicht gedreht!
 
Code:
procedure TForm1.FileListBox1Click(Sender: TObject);

var
  Jpeg: TJpegImage;
  bmp: TBitmap;
begin
  Jpeg:=TJpegImage.Create;
  bmp := TBitmap.Create;

  try

    jpeg.LoadFromFile(FileListBox1.FileName);
    bmp.Assign(jpeg);
    Image1.Picture.Assign(bmp);
    Image1.Picture.Bitmap.PixelFormat := pf24bit;
    Drehen90Grad(Image1.Picture.Bitmap);

  finally
    jpeg.free;
         end;

end;
:wall:

Danke :)


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