Results 1 to 5 of 5

Thread: Box to int

  1. #1
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default Box to int

    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

  2. #2
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

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

  3. #3
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Duh Haha, thanks so much

  4. #4
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Simba Code:
    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
    Working on: Tithe Farmer

  5. #5
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •