How to get viewport topLeft, topRight, bottomLeft, bottomRight

Does this demo give a hint for your case?