Registriert seit: 22. Okt 2004
359 Beiträge
|
Re: Visible eines Image=true aber trotzdem unsichtbar
20. Jul 2006, 09:22
Delphi-Quellcode:
if Feld[x1,y1]=0 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp0);
if Feld[x1,y1]=1 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp1);
if Feld[x1,y1]=2 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp2);
if Feld[x1,y1]=3 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp3);
if Feld[x1,y1]=4 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp4);
if Feld[x1,y1]=5 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp5);
if Feld[x1,y1]=6 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp1);
if (Feld[x1,y1]=7) and (bier=0) then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp2);
if (Feld[x1,y1]=7) and (bier<>0) then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp0);
if Feld[x1,y1]=8 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp0);
if Feld[x1,y1]=9 then form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp0);
Dafür gibt es eine wesentlich elegantere Methode:
Delphi-Quellcode:
case Feld[x1, y1] of
1, 6: form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp1);
2: form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp2);
3: form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp3);
4: form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp4);
5: form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp5);
7:
begin
if Bier = 0 then
Form1.Canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp2)
else
Form1.Canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp0);
end;
8, 9: form1.canvas.Draw(x1*32+70-xs,y1*32+70-ys,bmp0);
end;
|