Re: Need help with some pixel calculations

Here is my initial thoughts. assuming left to right and top to bottom are positive.


  1. Start at the point and go right
  2. Stop at each left and right edge of each box
  3. Save the top most edge postion
  4. If the top most edge ever goes less than or equal to point's top position then stop and keep the right and top potions
  5. Repeat but go down using top bottom edges saving the smallest left position
  6. When finished you will have 2 points so take the lowest value of each point to make the smallest allowable rectangle.
  7. select the largest rectangle from the 2 boxes if there are 2.

Do you see any holes in this theory?

Champion CLA Instructor

Making senseless computers do
intelligent real world things
is NOT easy. SO MAKE IT FUN!
0 Kudos