Get coordinates of viewport boundaries

This thread should help you with that.