Thema: Delphi PPoint zu short

Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#3

AW: PPoint zu short

  Alt 2. Mär 2018, 21:39
Ich erstelle ein Array of POINT

Delphi-Quellcode:
    xy[0].x := 80 + 150; xy[0].y := 135 + 150;
    xy[1].x := 140 + 150; xy[1].y := 130 + 150;
    xy[2].x := 160 + 150; xy[2].y := 80 + 150;
    xy[3].x := 180 + 150; xy[3].y := 130 + 150;
    xy[4].X := 240 + 150; xy[4].y := 135 + 150;
    xy[5].X := 192 + 150; xy[5].y := 165 + 150;
    xy[6].X := 210 + 150; xy[6].y := 220 + 150;
    xy[7].X := 160 + 150; xy[7].y := 190 + 150;
    xy[8].X := 110 + 150; xy[8].y := 220 + 150;
    xy[9].X := 128 + 150; xy[9].y := 165 + 150;

    gSprCtrl.GD_DrawPolyLineToCtrl(HSprCtrl, @xy[0], 10,
      gSprCtrl.GD_ColorARGB(255,RGB(100,250,150)), 5, ID_POLYLINE_1,
      GS_VISIBLE or GS_DRAFT, GD_DRAW_OUTLINE or GD_DRAW_OPEN, 0);
    meta := Pointer(pXY); // hier sind die Daten vom xy Array enthalten.

meta ist aber als TArray<short> definiert.

deshalb schlägt meine Zuweisung fehl..
Delphi-Quellcode:
    x1 := meta[0];
    y1 := meta[1];
    x2 := meta[(ArraySize * 2)- 2];
    y2 := meta[(ArraySize * 2)- 1];

das ist mein Problem.

EDIT:
Ich könnte das ganze jetzt auf 4 Byte umlegen also Integer (PPoint)
Delphi-Quellcode:
    x1 := meta[0];
    y1 := meta[2];
    x2 := meta[(ArraySize * 4)- 4];
    y2 := meta[(ArraySize * 4)- 2];
Ist aber irgendwo nicht der sinn der Sache wenn ich alle Datentypen verwurschtle.

gruss

Geändert von EWeiss ( 2. Mär 2018 um 21:52 Uhr)
  Mit Zitat antworten Zitat