Autor Beitrag
Daether
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Di 01.03.05 16:01 
Hi,
mein Problem ist foglendes:
Ich habe einen Dynamischne Array, der Polygone enthalten soll, welcher wiederum einen Array mit 2D-koordinaten beinhaltet. Sieht im Endeffekt so aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  
  TPunkt = record
             x,y,z : integer;
           end;
  TPolygon = record
               Punkte2D : array of TPoint;
               Punkte3D : array of TPunkt;
               Kantenfarbe, Flaechenfarbe : TColor;
               brush : TBrush;
             end;
  TKoerper = array of TPolygon;


Soweit so gut ;).
Meine Frage ist nun, da die länge des Arrays Punkte2D variiert, wie man eine funktion macht die ein Polygon zeichnet, welches seine Daten aus einem DYNAMISCHEN-Array gewinnt(das dynamische Array ist schon gefüllt!).
Kann mir da einer helfen?
wdbee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 628
Erhaltene Danke: 1



BeitragVerfasst: So 06.03.05 16:26 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
...
var
  I: Integer;
  MyArray: array of Tirgendwas;
begin
  SetLength(MyArray, MySize);
  for I := Low(MyArray) to High(MyArray) do
  ...
sourcehunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 482

Win XP | Suse 10.1
Delphi 2005 Pers.
BeitragVerfasst: So 06.03.05 17:52 
Wenn du canvas benutzt, dann machst du ein MoveTo zum Anfangspunkt und dann ein For i:=1 to Length(poly)-1 do LineTo.

_________________
Linux und OpenSource rulez!