Einzelnen Beitrag anzeigen

Benutzerbild von SirThornberry
SirThornberry
(Moderator)

Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
 
Delphi 2006 Professional
 
#6

Re: Quadrat 90° gedreht

  Alt 3. Mär 2006, 14:39
Da ich in meiner Übereifrigkeit vorhin "PolyPolyline" angesprochen hab welches eigentlich zum zeichnen mehrere Polygone gedacht ist hier mal ein Beispiel für die Verwendung um 10 Polygone zu malen. (jeweils immer mit den 5 Punkten von Oben um 10 Pixel nach rechts verschoben)
Delphi-Quellcode:
var LPoints: Array of TPoint;
    LPolyCnts: Array of Integer;
    LCount,
    LPolyCnt: Integer;
begin
  LPolyCnt := 10;
  SetLength(LPoints, 5 * LPolyCnt);
  SetLength(LPolyCnts, LPolyCnt);
  for LCount := 0 to LPolyCnt - 1 do
  begin
    LPoints[0 + 5 * LCount] := Point(50 + LCount * 8, 0);
    LPoints[1 + 5 * LCount] := Point(100 + LCount * 8, 50);
    LPoints[2 + 5 * LCount] := Point(50 + LCount * 8, 100);
    LPoints[3 + 5 * LCount] := Point(0 + LCount * 8, 50);
    LPoints[4 + 5 * LCount] := Point(50 + LCount * 8, 0);
    LPolyCnts[LCount] := 5;
  end;
  PolyPolyline(Image1.Picture.Bitmap.Canvas.Handle, Pointer(LPoints)^, Pointer(LPolyCnts)^, LPolyCnt);
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  Mit Zitat antworten Zitat