Background borders position in the scene (2D)

I have a static background in my game and I wanna know what are the borders positions of it in the scene. And then I can block the player to walk out of the background map.
Anyone knows how to do that? Thanks a lot!

If the background is a Sprite, you could use the postion of the Sprite and then use the Sprite.Bounds to get distance to each side. Use those bounds to stop the player from moving any further.