Autor Beitrag
matzehl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Di 15.02.05 09:53 
Moin alle zusammen!!!

Wie entferne ich aus einem TImage das Bild. Bevor ihr aufschreit... ich weiß, dass
man picture := nil setzen muss. Aber wenn ich über den Tag auf mein TImage zugreife funzt das nich. Bringt mir immer die Fehlermeldung "Operand ist auf diesen Operandentyp nicht anwendbar".
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.DrawSymbol(KanalNr:integer;FunctionName:string);
var i : integer;
begin
  for i := 0 to ComponentCount - 1 do
     if Components[i] is TImage and if TImage(Components[i]).tag = (1000+KanalNr)then
       if FunctionName = '0' then TImage(Components[i]).Picture := nil 
       else
       TImage(Components[i]).picture.bitmap.LoadFromResourceName(HInstance,FunctionName);
end;


Irgenwas in Zeile 6 und 8 stimmt nicht. Aber ich komme nich drauf. Typischer Fall von Code Blindheit :?

Moderiert von user profile iconGausi: Code- durch Delphi-Tags ersetzt.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 15.02.05 09:57 
Zeile 5 funktioniert???
Ich hätte das so geschrieben:
ausblenden Delphi-Quelltext
1:
     if (Components[i] is TImage) and (TImage(Components[i]).tag = (1000+KanalNr)) then