Simba Code:
function test: TMufasaBitmap;
var
t, bmpw, bmph:integer;
bmp, rotated: TMufasaBitmap;
amount:extended;
tpa, notpts : tpointarray;
box: tbox;
c: TClient;
sc: integer;
begin
//ClearDebugImg;
MarkTime(t);
SC := Smart_CurrentClient; //get current id of smart client
BMP := SPS_GatherMinimap; //gather the minimap image
SPS_FilterMinimap(bmp);
Amount := 0 - rs_GetCompassAngleRadians; //get the amount we need to rotate it by
Rotated := rotatebitmap(bmp.index,amount); //rotate the bitmap
GetBitmapSize(rotated, BMPW, BMPH);
SetTargetBitmap(Rotated); //set our target to the bitmap
FindColors(TPA, 0, 1, 1, bmpw-1, bmph-1); //find soild black (0) colors
ReturnPointsNotInTPAWrap(TPA, IntToBox(1, 1, bmpw-1, bmph-1), notpts); //return the points that arent black
Box := GetTPABounds(notpts); //get the bounds of the poits that arent black (the minimap circle)
BMP.free
Result := TMufasaBitmap.Create; //create a tmufasa bmp
Result.SetSize(150, 150); //set the size so no out of range stuff
c := getTClient; //get the client to copy from
Result.CopyClientToBitmap(
c.IOManager, false, 0, 0, Box.X1, Box.Y1, Box.X2, Box.Y2); //copy from the client onto the tmufasa
SetEIOSTarget('libsmartremote', ToStr(sc)); //re target to smart
FreeBitmap(Rotated);
Writeln('Rotating map took: '+tostr(timefrommark(t))+' ms');
//DrawBitmapDebugImg(result.index);
//DisplayDebugImgWindow(150, 150);
end;