SRL Archive - NOTA

dude


m3gaman3g3nd

2012-02-04 03:49:55

hi i dug this example out from the forums and modded it x2…

harharhar now it accepts t2darrays and yeah its beast… lol im done fer 2day sum 1 get this working please….

original
http://villavu.com/forum/showthread.php?t=60549&highlight=debugtpas

function DebugTPAs(TPAs: Array of array of TPointArray; Colors: TIntegerArray): Boolean;
var BMP, I: Integer;
Box: TBoxArray;
BoxTPA: T2dPointArray;
TempTPA: T2dPointArray;
begin
if (High(TPAs) <> High(Colors)) then begin
Result := False;
Exit;
end;
for I := 0 to High(TPAs) do begin
SetLength(BoxTPA, i+1);
AppendTPA(BoxTPA[i], TPAs[I][i]);
end;
for I := 0 to High(BoxTPA) do begin
SetLength(Box, i+1);
Box[i] := GetTPABounds(BoxTPA[i]);
BMP := BitmapFromClient(Box[i].X1, Box[i].Y1, Box[i].X2, Box[i].Y2);
end;
for I := 0 to High(TPAs) do begin
SetLength(TempTPA, i+1);
TempTPA[i] := CopyTPA(TPAs[I][i]);
OffsetTPA(TempTPA[i], point(-box[i].x1,-box[i].Y1));
DrawTPABitmap(BMP, TempTPA[i], Colors[I]);

end;
DisplayDebugImgWindow(Box[i].X2 - Box[i].X1 + 1, Box[i].Y2 - Box[i].Y1 + 1);//out of range =(
DrawBitmapDebugImg(BMP);
FreeBitmap(BMP);
Result := True;
end;