Brandon
2012-03-03 14:04:06
I'll get straight to the point:
I got an atpa made with:
TPAToATPAEx(70, 70);
I want to delete anything that is smaller than 30 but larger than 70 but still be able to use the ATPA.. How can I do this?
I was thinking:
I got an atpa made with:
TPAToATPAEx(70, 70);
I want to delete anything that is smaller than 30 but larger than 70 but still be able to use the ATPA.. How can I do this?
I was thinking:
{$I SRL/SRL.Simba}
var
MyBox, MidBox: TBox;
Width, Height, X, Y: Integer;
begin
MyBox:= GetTPABounds(ATPA[0]);
MidBox:= MiddleBox(MyBox);
MiddleTPAEx(ATPA[0], X, Y);
Width:= iAbs(MyBox.X2 - MyBox.X1);
Height:= iAbs(MyBox.Y2 - MyBox.Y1);
if ((Width >= 30) AND (Width <= 70) And (Height >= 30) AND (Height <= 70)) then
For I:= 0 To High(ATPA[0]) do
if (Not PointInBox(Point(X, Y), MyBox)) then
DeleteValueInTPA(ATPA[0], I);
else
//The Box is larger than 70.. so shrink it to BxB.. and delete points not in the 70x70 box.. Where 30 <= B <= 70
//AND if the box is smaller than 30.. then delete all the points in the ATPA at that position :S
end.
But I just can't figure it out :S