Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TPAUnique(var TPA: TPointArray);
- var
- h, h2, i, i2, i3, d: Integer;
- begin
- h := High(TPA);
- if (h < 1) then
- Exit;
- for i := (h - d) downto 1 do
- for i2 := (i - 1) downto 0 do
- if ((TPA[i].X = TPA[i2].X) and (TPA[i].Y = TPA[i2].Y)) then
- begin
- h2 := High(TPA);
- for i3 := i to (h2 - 1) do
- TPA[i3] := TPA[(i3 + 1)];
- SetLength(TPA, h2);
- Inc(d);
- Break;
- end;
- end;
- function FindColorsMulti(colors: TIntegerArray; xs, ys, xe, ye: Integer): TPointArray;
- var
- l, i: Integer;
- ATPA: T2DPointArray;
- begin
- ClearSameIntegers(colors);
- l := Length(colors);
- if (l < 1) then
- Exit;
- SetLength(ATPA, l);
- for i := 0 to (l - 1) do
- if ((colors[i] >= 0) and (colors[i] <= 16777215)) then
- FindColors(ATPA[i], colors[i], xs, ys, xe, ye);
- Result := MergeATPA(ATPA);
- SetLength(ATPA, 0);
- TPAUnique(Result);
- end;
- var
- i: Integer;
- TPA: TPointArray;
- ATPA: array of TPointArray;
- begin
- LoadFont('RSCMainFont', False);
- ClearDebug;
- ActivateClient;
- Wait(2000);
- i := GetSystemTime;
- TPA := FindColorsMulti([65535, 4231423, 16776960, 16777215], 3, 2, 311, 18);
- ATPA := SplitTPAEx(TPA, 1, 11);
- SortATPAFromFirstPoint(ATPA, Point(0, 0));
- SetLength(TPA, 0);
- try
- WriteLn(GetTextATPA(ATPA, 2, 'RSCMainFont'));
- except
- end;
- SetLength(ATPA, 0);
- FreeFont('RSCMainFont');
- end.
Advertisement
Add Comment
Please, Sign In to add comment