Simba Code:
Procedure GetMinimap(var Map: Integer);
var
TPA, Draw: TPointArray;
TIA: TIntegerArray;
I, BMP: Integer;
begin
BMP:= CreateBitmap(MMX2 - MMX1 + 1, MMY2 - MMY1 + 1);
TPA:= TPAFromBox(MMBox);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, MMCX, MMCY);
TIA:= GetColors(TPA);
TPA:= TPAFromBox(IntToBox(0, 0, MMX2 - MMX1, MMY2 - MMY1));
DrawTPABitmap(BMP, TPA, 0);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, (MMX2 - MMX1)/2, (MMY2 - MMY1)/2);
SetLength(DRAW, 1);
For I:= 0 To High(TPA) do
begin
Draw[0]:= TPA[I];
DrawTPABitmap(BMP, Draw, TIA[I]);
end;
For I:= 0 To High(TPA) do
begin
if (SimilarColors(TIA[I], 67075, 20)) then //If similar to black, make it completely black.
FastSetPixel(BMP, TPA[I].X, TPA[I].Y, clBlack);
end;
Map:= CopyBitmap(Bmp);
FreeBitmap(BMP);
end;
Function FindBitmapInBitmap(XBMP, YBMP, Tol: Integer): Boolean;
var
Similar, NotSimilar, I, J, X: Integer;
BMPC1, BMPC2: T2DIntegerArray;
begin
try
BMPC1:= GetBitmapAreaColors(XBMP, 0, 0, 150, 150);
BMPC2:= GetBitmapAreaColors(YBMP, 0, 0, 150, 150);
X:= High(BMPC1);
For I:= 0 To 150 do
begin
For J:= 0 To 150 do
begin
if ((SimilarColors(BMPC1[J][I], 0, 20)) or (SimilarColors(BMPC2[J][I], 0, 20))) then //If similar to black, ignore it..
Continue;
if (SimilarColors(BMPC1[J][I], BMPC2[J][I], Tol)) then
Inc(Similar)
else
Inc(NotSimilar);
end;
end;
Result:= Similar > NotSimilar;
except
Result:= False;
end;
end;