I want to find the edges of a square depends on the position of the player.

Here is a picture of what I'm talking about.

1, 2, 3 and 4 are ImagePoints. So depends on the player's position, the edges are different. In the left one, 3 and 4 are the edges, In the middle 3 and 2 and in the right 1 and 4 are the edges. There are overall 8 possibilities, I just showed 3 of them. I would appreciate if someone make a capx file and uplaod it.

Thank you