Thema: Delphi Image als Bedingung?

Einzelnen Beitrag anzeigen

Hellcat

Registriert seit: 27. Feb 2003
60 Beiträge
 
Delphi 6 Personal
 
#7
  Alt 3. Mär 2003, 08:19
So hier kommt noch mal die bereinigte Version des Codes...
Delphi-Quellcode:
procedure TForm1.Image1Click(Sender: TObject);
var BitmapO: TBitmap;
begin
    if Image1.picture = schloss zu.bmp then
    begin
      BitmapO := TBitmap.create;
      BitmapO.LoadFromFile('schloss offen.bmp');
      Image1.Picture.LoadfromFile('schloss offen.bmp');
    end
  else
    begin
      BitmapO := TBitmap.create;
      BitmapO.LoadFromFile('schloss zu.bmp');
      Image1.Picture.LoadfromFile('schloss zu.bmp')
    end;
end;
Das Problem ist folgendes: Bei Zeile "if Image1.picture..." kommt immer die Meldung "Undeclared identifier" - wenn ich das Bild aber so angebe wie unten kommt "Incompatible types: 'String' and 'TPicture' ". Wie muss ich das also angeben bzw. geht das so überhaupt?
  Mit Zitat antworten Zitat