Pass the TMufasaBitmap. Then use FastGetPixel.
GetMufasaBitmap(bmp) returns the TMufasaBitmap.
E:
Simba Code:
program new;
function G_MakeColorBoxEx(bmp: TMufasaBitmap; x1, y1: integer): Array of Integer; //[0]=Red [1]=Green [2]=Blue
var
x, y: integer;
R, G, B: integer;
begin
SetLength(Result, 3);
for x := x1 to (x1 + 4) do
for y := y1 to (y1 + 5) do
begin
try
ColorToRGB(bmp.FastGetPixel(x, y), R, G, B);
Result[0] := Result[0] + R;
Result[1] := Result[1] + G;
Result[2] := Result[2] + B;
except
//writeln('ColorToRGB exception: '+inttostr(x)+', '+inttostr(y));
end;
end;
end;
var
bmp, w, h: Integer;
mbmp: TMufasaBitmap;
begin
bmp := CreateBitmap(10, 10);
mbmp := GetMufasaBitmap(bmp);
GetClientDimensions(w,h);
mbmp.CopyClientToBitmap(GetTClient.IOManager, True, 0, 0, 0, 0, w-1, h-1);
G_MakeColorBoxEx(mbmp, 42, 42);
end.
You'll need to include parts of the MML in your plugin. (You should anyway)