SRL Archive - OSR Help

Box to int


P1ng

2012-06-22 08:10:43

Is there a function that is like the reverse of IntToBox?

IntToBox takes the co-ords xs,ys,xe,ye and turns it into a TBox. I want to take a TBox and then search within it using FindColorsSpiralTolerance but I don't know how to convert the box into it's individual co-ordinates.

Thanks in advance for any suggestions :)

Sin

2012-06-22 08:11:47

Box.x1, Box.y1, Box.x2, Box.y2

P1ng

2012-06-22 08:16:46

Duh :duh: Haha, thanks so much :)

masterBB

2012-06-22 08:19:06

type 
TBox = record
x1, x2, y1, y2: Integer;
end;

function IntToBox(x1, y1, x2, y2: Integer): TBox;
begin
Result.x1 := x1;
Result.x2 := x2;
Result.y1 := y1;
Result.y2 := y2;
end;

So it is just:
yourBox.x1
yourBox.x2
yourBox.y1
yourBox.y2

edit: I am slow

P1ng

2012-06-22 08:24:36

Haha well, I found a colour then used GetTPABounds to create a TBox then I wanted to check if another colour was within that area but in order to use FindColorsSpiralTolerance I needed to convert my TBox into co-ordinates, so Shay has got me sorted now :)