Re: Need help with some pixel calculations
Here is my initial thoughts. assuming left to right and top to bottom are positive.
- Start at the point and go right
- Stop at each left and right edge of each box
- Save the top most edge postion
- 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
- Repeat but go down using top bottom edges saving the smallest left position
When finished you will have 2 points so take the lowest value of each point to make the smallest allowable rectangle.
- select the largest rectangle from the 2 boxes if there are 2.
Do you see any holes in this theory?