Code:
procedure DebugATPABounds(aPoints: Array Of TPointArray);
var
Width, Height, ClientBMP, I, x2, y2, h : Integer;
B: TBox;
BoxColors : Array Of Integer;
SelColor: Integer;
begin
GetClientDimensions(x2,y2);
width := x2;
height := y2;
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, 0, 0, width, height);
DisplayDebugImgWindow(Width, Height);
{$IFDEF SIMBA}
DrawBitmapDebugImg(ClientBmp);
BoxColors := [clRed, clBlue, clBlack, clGreen, clYellow];
DrawATPABitmapEx(ClientBMP, aPoints, BoxColors);
DrawBitmapDebugImg(ClientBMP);
FreeBitmap(ClientBMP);
{$ELSE}
SafeDrawBitmap(ClientBmp, GetDebugCanvas, 0, 0);
GetDebugCanvas.Font.Style := [fsBold];
GetDebugCanvas.Brush.Style := bsClear;
BoxColors := [clRed, clBlue, clBlack, clGreen, clYellow];
for i:= 0 to high(aPoints) do
begin
SelColor := BoxColors[Random(length(Boxcolors))];
GetDebugCanvas.Pen.Color := SelColor;
GetDebugCanvas.Font.Color := SelColor;
B := GetTPABounds(aPoints[i]);
GetDebugCanvas.Rectangle(B.x1,B.y1,B.x2,B.y2);
GetDebugCanvas.TextOut(B.x1,B.y1,inttostr(i));
end;
FreeBitmap(ClientBmp);
{$ENDIF}
end;
Could you try this? I've never used ATPAs do I don't know how to try them out, but from reading through the source, this should work.
I could tweak it to draw on Smart's Debug Canvas either.
~mc_teo