Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#11

AW: inkompatibel TArray<Integer> Pointer

  Alt 4. Aug 2018, 15:54
Ich weiß ja nicht, wie du pXY zuweist. Wenn das ein Pointer auf das erste Element eines TArray<Integer> ist, dann funktioniert das natürlich, weil dann die betreffenden Speicherbereiche ja sinnvolle Werte beinhalten.
So!

Delphi-Quellcode:
    xy[0].x := 80 + 110; xy[0].y := 135 + 50;
    xy[1].x := 140 + 110; xy[1].y := 130 + 50;
    xy[2].x := 160 + 110; xy[2].y := 80 + 50;
    xy[3].x := 180 + 110; xy[3].y := 130 + 50;
    xy[4].X := 240 + 110; xy[4].y := 135 + 50;
    xy[5].X := 192 + 110; xy[5].y := 165 + 50;
    xy[6].X := 210 + 110; xy[6].y := 220 + 50;
    xy[7].X := 160 + 110; xy[7].y := 190 + 50;
    xy[8].X := 110 + 110; xy[8].y := 220 + 50;
    xy[9].X := 128 + 110; xy[9].y := 165 + 50;
Delphi-Quellcode:
    gSprCtrl.GD_DrawPolyLineToCtrl(HSprCtrl, @xy[0], 10,
      gSprCtrl.GD_ColorARGB(255,RGB(100, 250, 150)), 5, ID_POLYLINE,
      GS_VISIBLE or GS_DRAFT, GD_DRAW_OUTLINE, 0);
        gSprCtrl.GD_SetObjectImageLabel(ID_ELLIPSE, 'Polyline');
Siehe @xy[0]..
Delphi-Quellcode:
function TSkinSpriteContainer.GD_DrawPolyLineToCtrl(WinHandle: HWND; pXY: PPoint;
  ArraySize: Integer; ColrARGB: Colorref; BorderSize, ObjID, GS_STYLE, GD_STYLE: DWORD;
  Use3D: Short): BOOL;
begin

  Result := False;

  if (IsWindow(WinHandle)) then
    Result := gDrawPointsObject(OBJECT_POLYLINE, WinHandle, pXY, ArraySize, ColrARGB, BorderSize,
      ObjID, GS_STYLE, GD_STYLE, Use3D);

end;
und..
Delphi-Quellcode:
function TSkinSpriteContainer.gDrawPointsObject(ObjectType: Integer; WinHandle: HWND; pXY: PPoint;
  ArraySize: Integer; ColrARGB: Colorref; BorderSize, ObjID, GS_STYLE, GD_STYLE: DWORD;
  Use3D: Short): BOOL;
var
  ExistItem, Item: Integer;
  x1, y1, x2, y2: Integer;
  Border, K, C: Integer;
  meta: TArray<Integer>;
  pData: Short;
begin
//...

    meta := Pointer(pXY); // funktioniert mit D2010

    x1 := meta[0];
    y1 := meta[1];
    x2 := meta[(ArraySize * 2) - 2];
    y2 := meta[(ArraySize * 2) - 1];

end;
aber wie schon gesagt es geht in D2010 aber nicht mit Tokyo
Ich lasse es erst mal mit der 64Bit Version.. das ist mir echt suspekt das ganze.

Danke..

gruss

Geändert von EWeiss ( 4. Aug 2018 um 16:21 Uhr)
  Mit Zitat antworten Zitat