Autor Beitrag
gast2000
Hält's aus hier
Beiträge: 1



BeitragVerfasst: So 14.10.07 16:15 
hallo!
wie kann ich ein rechteck in TImage zeichnen lassen und dieses in mehrfacher ausführung (spalten und zeilen) von delphi mit pascal zeichnen lassen?
bitte um schnelle antwort, vielen dank!!!
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 14.10.07 16:41 
Ist auf einem TPaint:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
const
  w=40; //width
  h=30; //height
  t=0; //top of grid
  s=1; //space between cells
//---------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var x,y:integer;
    px,py:integer;
begin

with PB1.canvas do
BEGIN
  brush.color:=clmoneygreen;
  for x:=0 to 16 do
  begin
    for y:=0 to 16 do
    begin
      px:=X*(s+w)+t;
      py:=Y*(s+h)+t;
      Rectangle(px,py,px+w,py+h);
      textout(px+4,py+8,inttostr(x)+'-'+inttostr(y));
    end;
  end;
END;
end;
Einloggen, um Attachments anzusehen!