Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi TPicture inkompatibel mit Typ String (https://www.delphipraxis.net/112935-tpicture-inkompatibel-mit-typ-string.html)

ts-d 29. Apr 2008 21:05


TPicture inkompatibel mit Typ String
 
Problem:

Ich möchte eine Bedingung formulieren: Wenn eine TImage-Komponente ein bestimmtes Bild geladen hat, soll ein anderes nicht geladen werden. Dazu muss ich aber das geladene Bild irgendwie herausbekommen. Wenn ich schreibe:

Delphi-Quellcode:
if (B_SucheStarten.Picture = './Data/buttons/Suche-starten2.jpg') ...
kommt als Fehlermeldung TPicture ist nicht mit TString kompatibel.

Mit
Delphi-Quellcode:
if (B_SucheStarten.Picture.Graphic.GetNamePath = './Data/buttons/Suche-starten2.jpg') ...

funtkioniert's auch nicht. Weiß jemand, wie man TPicture in TString umwandelt?

vg
ts-d

Apollonius 29. Apr 2008 21:06

Re: TPicture inkompatibel mit Typ String
 
Gar nicht. Im TPicture wird nur ein Bild gespeichert, keine Kontextdaten. Diese musst du selbst speichern.

ts-d 29. Apr 2008 21:11

Re: TPicture inkompatibel mit Typ String
 
danke - das geht einfach. vg


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