Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Wie bekommt man die Bitmap aus einem TImage? (https://www.delphipraxis.net/202084-wie-bekommt-man-die-bitmap-aus-einem-timage.html)

skoschke 26. Sep 2019 09:40

Wie bekommt man die Bitmap aus einem TImage?
 
Hallo,

ein TImage wird mit einem JPEG gefüllt:
Delphi-Quellcode:
    JPEG := TJPEGImage.Create;
    JPEG.LoadFromStream(....);
    Image := TImage.create(self);
    Image.Picture.Assign(JPEG);
Das TImage zeigt das Bild korrekt an, ich benötige das Bitmap dieses Bildes, nur wie?

Ciao
Stefan

Neutral General 26. Sep 2019 09:59

AW: Wie bekommt man die Bitmap aus einem TImage?
 
Es gibt Image.Picture.Bitmap. Kann aber sein, dass das nil ist bei einem JPG.
Dann musst du dir einfach ein eigenes TBitmap erstellen und ein
Delphi-Quellcode:
bitmap.Assign(Image.Picture.Graphic)
bzw.
Delphi-Quellcode:
bitmap.Assign(JPEG)
bzw machen.

skoschke 26. Sep 2019 10:31

AW: Wie bekommt man die Bitmap aus einem TImage?
 
Vielen herzlichen Dank!

ja, Image.Picture.Bitmap ist nicht nutzbar wenn ein JPEG geladen wurde.
Aber über den Umweg eines weiteren TBitmap funktioniert es :-D

Ciao
Stefan


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