Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   D2010, TPngImage LoadFromStream -> ungültiges Format (https://www.delphipraxis.net/152752-d2010-tpngimage-loadfromstream-ungueltiges-format.html)

hoika 5. Jul 2010 09:52

D2010, TPngImage LoadFromStream -> ungültiges Format
 
Hallo #,

meine PNG-Images liegen in ener DB.
Per TMemoryStream hole ich mir ein Bild und will es anzeigen (Canvas.Draw).

Fehlermeldung beim Draw "ungültiges Format, kein Header"

Speichere ich den Stream vorher in eine Datei und lade das PNG aus dieser Datei

Delphi-Quellcode:
Stream.SaveToFile
PngImage.LoadFromFile
klappt alles ???

Kennt jemand das Problem und eine Lösung ;)

Danke

Heiko

Bernhard Geyer 5. Jul 2010 09:57

AW: D2010, TPngImage LoadFromStream -> ungültiges Format
 
Positionier den Stream vor dem Laden ins PNG erstmal wieder auf den Anfang

Uwe Raabe 5. Jul 2010 10:02

AW: D2010, TPngImage LoadFromStream -> ungültiges Format
 
Probier mal Folgendes:

Delphi-Quellcode:
Stream.Position := 0;
PngImage.LoadFromStream(Stream);
Edit: Wo war der Hinweis auf die andere Antwort????

hoika 5. Jul 2010 10:06

AW: D2010, TPngImage LoadFromStream -> ungültiges Format
 
Hallo,

aaaah.

das wars.

(Ich hatte LoadFromStream 2mal gemacht und nur ein Position:= 0).

Danke


Heiko


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