Autor Beitrag
Beutel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

WIN XP

BeitragVerfasst: Fr 04.03.05 15:04 
Ich will gern ein TImage vergleien was für ein Bild da drin steht aber wenn ich das mache bringt er mir denn Fehler : Inkompatible Typen: 'String' und 'TPicture'

ausblenden Delphi-Quelltext
1:
2:
if  Img_Bild2.Picture = ('C:\Delphi7\...\2.jpg') then
    Img_Bild2.Picture.LoadFromFile ('C:\Delphi7\...\3.jpg')


So ungefähr und ich hab keinen Plan!

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 04.03.05 15:11 
Beutel hat folgendes geschrieben:
ausblenden Quelltext
1:
 if  Img_Bild2.Picture = ('C:\Delphi7\...\2.jpg') then ...					

img2_Bild.Picture ist ein Bild, 'C:\Delphi...' ist ein String. Wie soll man das auch vergleichen können?

Da Delphi AFAIK keine Methoden bereitstellt, um Bilder auf Gleichheit überprüfen zu können, muss man da wohl was anderes machen. Z.B. eine weitere Variable einführen, die immer dann geändert wird, wenn man ein Bild lädt, oder z.B. die "Tag"-Eigenschaft des TImages verwenden.

_________________
We are, we were and will not be.