Kod: Tümünü seç
tabpoly = array[0..9] of TPoint
Neyi gözden kaciriyor olabilirim?
Kod: Tümünü seç
tabpoly = array[0..9] of TPoint
Kod: Tümünü seç
var
Tab: tabpoly;
begin
Tab := gettabspoly(x1, y1, x2, y2);
...islemler
end;
Kod: Tümünü seç
const
PolyTabCount = 10;
type
//TabPoly = array [0 .. 9] of TPoint; --> Statigi inaktif edip
TabPoly = array of TPoint; // Dinamik hale getirdim
Kod: Tümünü seç
function GetTabsPoly(x1, y1, x2, y2: Integer): TabPoly; //inline;
begin
SetLength(Result, PolyTabCount); // Dinamik oldugu icin genisligi set ediyorum
Result[0].x := x1;
Result[0].y := y2;
Result[1].x := x1 + 3;
Result[1].y := y2 - 4;
Result[2].x := x1 + 11;
Result[2].y := y1 + 3;
Result[3].x := x1 + 13;
Result[3].y := y1 + 1;
Result[4].x := x1 + 15;
Result[4].y := y1;
Result[5].x := x2 - 15;
Result[5].y := y1;
Result[6].x := x2 - 13;
Result[6].y := y1 + 1;
Result[7].x := x2 - 11;
Result[7].y := y1 + 3;
Result[8].x := x2 - 3;
Result[8].y := y2 - 4;
Result[9].x := x2;
Result[9].y := y2;
end;
Kod: Tümünü seç
var
Tab: TabPoly;
begin
... islemler
Tab := GetTabsPoly(x1, y1, x2, y2);
TabsCanvas.FillPolygon(Brushes[1], PGPPoint(@Tab), PolyTabCount);
end;
Kod: Tümünü seç
TabsCanvas.FillPolygon(Brushes[1], PGPPoint(Tab), PolyTabCount);